Commit 35666bb8 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Todd Kjos
Browse files

FROMGIT: f2fs: complete checkpoints during remount



Otherwise, pending checkpoints can contribute a race condition to give a
quota warning.

- Thread                      - checkpoint thread
                              add checkpoints to the list
do_remount()
 down_write(&sb->s_umount);
 f2fs_remount()
                              block_operations()
                               down_read_trylock(&sb->s_umount) = 0
 up_write(&sb->s_umount);
                               f2fs_quota_sync()
                                dquot_writeback_dquots()
                                 WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));

Or,

do_remount()
 down_write(&sb->s_umount);
 f2fs_remount()
                              create a ckpt thread
                              f2fs_enable_checkpoint() adds checkpoints
			      wait for f2fs_sync_fs()
                              trigger another pending checkpoint
                               block_operations()
                                down_read_trylock(&sb->s_umount) = 0
 up_write(&sb->s_umount);
                                f2fs_quota_sync()
                                 dquot_writeback_dquots()
                                  WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));

Bug: 242127451
Bug: 215554521
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Change-Id: I85926fe14245058e48bac5699a7b760d7700c653
(cherry picked from commit d14393c5bff2f0c163e6bb384618300e30d19754
     https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
parent 9e14ab97
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment