Skip to content

Commit

Permalink
ext4: eliminate sleep from shutdown ioctl
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Theodore Ts'o committed Feb 19, 2018
1 parent 576d18e commit a6d9946
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a6d9946

Please sign in to comment.