Skip to content

Commit c02599f

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: avoid attaching SB_ACTIVE flag during mount
Quoted from [1] "I do remember that I've added this code back then because otherwise orphan cleanup was losing updates to quota files. But you're right that now I don't see how that could be happening and it would be nice if we could get rid of this hack" [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00 Related fix in ext4 by commit 72ffb49 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()"). f2fs has the same hack implementation in - f2fs_recover_orphan_inodes() - f2fs_recover_fsync_data() Let's get rid of this hack as well in f2fs. Cc: Zhang Yi <yi.zhang@huawei.com> Cc: Jan Kara <jack@suse.cz> Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent a5c0042 commit c02599f

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
705705
}
706706

707707
#ifdef CONFIG_QUOTA
708-
/* Needed for iput() to work correctly and not trash data */
709-
sbi->sb->s_flags |= SB_ACTIVE;
710-
711708
/*
712709
* Turn on quotas which were not enabled for read-only mounts if
713710
* filesystem has quota feature, so that they are updated correctly.

fs/f2fs/recovery.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
787787
}
788788

789789
#ifdef CONFIG_QUOTA
790-
/* Needed for iput() to work correctly and not trash data */
791-
sbi->sb->s_flags |= SB_ACTIVE;
792790
/* Turn on quotas so that they are updated correctly */
793791
quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
794792
#endif
@@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
816814
err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
817815
if (!err)
818816
f2fs_bug_on(sbi, !list_empty(&inode_list));
819-
else {
820-
/* restore s_flags to let iput() trash data */
821-
sbi->sb->s_flags = s_flags;
822-
}
817+
else
818+
f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
823819
skip:
824820
fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
825821

0 commit comments

Comments
 (0)