Skip to contentSkip to conversation

f2fs: fix a bug caused by NULL extent tree

PATCH Superseded Yunlei He 1 participant 1 message May 17, 2017 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/1 f2fs: fix a bug caused by NULL extent tree

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.

---
 fs/f2fs/extent_cache.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/extent_cache.c +3 -0
index 2f98d70..5c9ba22 100644
@@ -327,6 +327,9 @@ bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 	struct extent_node *en;
 	struct extent_info ei;
 
+	if (!test_opt(F2FS_I_SB(inode), EXTENT_CACHE))
+		set_inode_flag(inode, FI_NO_EXTENT);
+
 	if (!f2fs_may_extent_tree(inode)) {
 		/* drop largest extent */
 		if (i_ext && i_ext->len) {
Signature · 6 lines
1.9.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot