Update fixes for making ext4 more robust against malicious images
[ext4-patch-queue.git] / shutdown-eliminate-sleep
blob7b4ec06ba9d43266ab26c8d18019ef4e293e0204
1 ext4: eliminate sleep from shutdown ioctl
3 The msleep() when processing EXT4_GOING_FLAGS_NOLOGFLUSH was a hack to
4 avoid some races (that are now fixed), but in fact it introduced its
5 own race.
7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 Cc: stable@vger.kernel.org
9 ---
10  fs/ext4/ioctl.c | 4 +---
11  1 file changed, 1 insertion(+), 3 deletions(-)
13 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
14 index 4d1b1575f8ac..16d3d1325f5b 100644
15 --- a/fs/ext4/ioctl.c
16 +++ b/fs/ext4/ioctl.c
17 @@ -498,10 +498,8 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
18                 break;
19         case EXT4_GOING_FLAGS_NOLOGFLUSH:
20                 set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
21 -               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) {
22 -                       msleep(100);
23 +               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal))
24                         jbd2_journal_abort(sbi->s_journal, 0);
25 -               }
26                 break;
27         default:
28                 return -EINVAL;