All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.4] f2fs: fix a bug caused by NULL extent tree
@ 2018-02-27 11:23 Nikolay Borisov
  2018-02-28 12:28 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2018-02-27 11:23 UTC (permalink / raw)
  To: stable; +Cc: chao2.yu, jaegeuk, cm224.lee, Yunlei He, Nikolay Borisov

From: Yunlei He <heyunlei@huawei.com>

Thread A:					Thread B:

-f2fs_remount
    -sbi->mount_opt.opt = 0;
						<--- -f2fs_iget
						         -do_read_inode
							     -f2fs_init_extent_tree
							         -F2FS_I(inode)->extent_tree is NULL
        -default_options && parse_options
	    -remount return
						<---  -f2fs_map_blocks
						          -f2fs_lookup_extent_tree
                                                              -f2fs_bug_on(sbi, !et);

The same problem with f2fs_new_inode.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---

Hello Greg, 

I would like to have upstream commit dad48e73127b ("f2fs: fix a bug
caused by NULL extent tree") included in the 4.4 stable kernel. This is the 
backport of it. 

 fs/f2fs/extent_cache.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
index 7ddba812e11b..6827b9c942dc 100644
--- a/fs/f2fs/extent_cache.c
+++ b/fs/f2fs/extent_cache.c
@@ -172,7 +172,7 @@ void f2fs_drop_largest_extent(struct inode *inode, pgoff_t fofs)
 	__drop_largest_extent(inode, fofs, 1);
 }
 
-void f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+static void __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 {
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct extent_tree *et;
@@ -204,6 +204,14 @@ void f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 	write_unlock(&et->lock);
 }
 
+void f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+{
+	__f2fs_init_extent_tree(inode, i_ext);
+
+	if (!F2FS_I(inode)->extent_tree)
+		set_inode_flag(F2FS_I(inode), FI_NO_EXTENT);
+}
+
 static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 							struct extent_info *ei)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 4.4] f2fs: fix a bug caused by NULL extent tree
  2018-02-27 11:23 [PATCH 4.4] f2fs: fix a bug caused by NULL extent tree Nikolay Borisov
@ 2018-02-28 12:28 ` Greg KH
  2018-02-28 13:46   ` [PATCH 4.9.y] " Nikolay Borisov
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-02-28 12:28 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: stable, chao2.yu, jaegeuk, cm224.lee, Yunlei He

On Tue, Feb 27, 2018 at 01:23:05PM +0200, Nikolay Borisov wrote:
> From: Yunlei He <heyunlei@huawei.com>
> 
> Thread A:					Thread B:
> 
> -f2fs_remount
>     -sbi->mount_opt.opt = 0;
> 						<--- -f2fs_iget
> 						         -do_read_inode
> 							     -f2fs_init_extent_tree
> 							         -F2FS_I(inode)->extent_tree is NULL
>         -default_options && parse_options
> 	    -remount return
> 						<---  -f2fs_map_blocks
> 						          -f2fs_lookup_extent_tree
>                                                               -f2fs_bug_on(sbi, !et);
> 
> The same problem with f2fs_new_inode.
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> 
> Hello Greg, 
> 
> I would like to have upstream commit dad48e73127b ("f2fs: fix a bug
> caused by NULL extent tree") included in the 4.4 stable kernel. This is the 
> backport of it. 

It also needs to go to 4.9.y, right?

Can you provide a backport for that?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 4.9.y] f2fs: fix a bug caused by NULL extent tree
  2018-02-28 12:28 ` Greg KH
@ 2018-02-28 13:46   ` Nikolay Borisov
  2018-02-28 14:44     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2018-02-28 13:46 UTC (permalink / raw)
  To: greg; +Cc: stable, jaegeuk, heyunlei, Nikolay Borisov

From: Yunlei He <heyunlei@huawei.com>

Thread A:					Thread B:

-f2fs_remount
    -sbi->mount_opt.opt = 0;
						<--- -f2fs_iget
						         -do_read_inode
							     -f2fs_init_extent_tree
							         -F2FS_I(inode)->extent_tree is NULL
        -default_options && parse_options
	    -remount return
						<---  -f2fs_map_blocks
						          -f2fs_lookup_extent_tree
                                                              -f2fs_bug_on(sbi, !et);

The same problem with f2fs_new_inode.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
Hi, 

Here is the 4.9.y backport

 fs/f2fs/extent_cache.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
index 7b32ce979fe1..63e519658d73 100644
--- a/fs/f2fs/extent_cache.c
+++ b/fs/f2fs/extent_cache.c
@@ -177,7 +177,7 @@ static void __drop_largest_extent(struct inode *inode,
 }
 
 /* return true, if inode page is changed */
-bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 {
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct extent_tree *et;
@@ -215,6 +215,16 @@ bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 	return false;
 }
 
+bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+{
+	bool ret =  __f2fs_init_extent_tree(inode, i_ext);
+
+	if (!F2FS_I(inode)->extent_tree)
+		set_inode_flag(inode, FI_NO_EXTENT);
+
+	return ret;
+}
+
 static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 							struct extent_info *ei)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 4.9.y] f2fs: fix a bug caused by NULL extent tree
  2018-02-28 13:46   ` [PATCH 4.9.y] " Nikolay Borisov
@ 2018-02-28 14:44     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2018-02-28 14:44 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: stable, jaegeuk, heyunlei

On Wed, Feb 28, 2018 at 03:46:41PM +0200, Nikolay Borisov wrote:
> From: Yunlei He <heyunlei@huawei.com>
> 
> Thread A:					Thread B:
> 
> -f2fs_remount
>     -sbi->mount_opt.opt = 0;
> 						<--- -f2fs_iget
> 						         -do_read_inode
> 							     -f2fs_init_extent_tree
> 							         -F2FS_I(inode)->extent_tree is NULL
>         -default_options && parse_options
> 	    -remount return
> 						<---  -f2fs_map_blocks
> 						          -f2fs_lookup_extent_tree
>                                                               -f2fs_bug_on(sbi, !et);
> 
> The same problem with f2fs_new_inode.
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> Hi, 
> 
> Here is the 4.9.y backport

Thanks, both now applied.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-28 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 11:23 [PATCH 4.4] f2fs: fix a bug caused by NULL extent tree Nikolay Borisov
2018-02-28 12:28 ` Greg KH
2018-02-28 13:46   ` [PATCH 4.9.y] " Nikolay Borisov
2018-02-28 14:44     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.