ext4: eliminate sleep from shutdown ioctl
authorTheodore Ts'o <tytso@mit.edu>
Mon, 19 Feb 2018 04:16:28 +0000 (23:16 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Feb 2018 04:16:28 +0000 (23:16 -0500)
The msleep() when processing EXT4_GOING_FLAGS_NOLOGFLUSH was a hack to
avoid some races (that are now fixed), but in fact it introduced its
own race.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
fs/ext4/ioctl.c

index 4d1b1575f8ac7d1f700c44fbfe659c16dfd3dda9..16d3d1325f5bb017db004b52018066c8ba7977aa 100644 (file)
@@ -498,10 +498,8 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
                break;
        case EXT4_GOING_FLAGS_NOLOGFLUSH:
                set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
-               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) {
-                       msleep(100);
+               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal))
                        jbd2_journal_abort(sbi->s_journal, 0);
-               }
                break;
        default:
                return -EINVAL;