add patch shutdown-eliminate-sleep
[ext4-patch-queue.git] / shutdown-eliminate-sleep
blob867961f1ce420a6d6bca5c4f8d0b6f44d35adfaf
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 ---
9  fs/ext4/ioctl.c | 4 +---
10  1 file changed, 1 insertion(+), 3 deletions(-)
12 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
13 index 4d1b1575f8ac..16d3d1325f5b 100644
14 --- a/fs/ext4/ioctl.c
15 +++ b/fs/ext4/ioctl.c
16 @@ -498,10 +498,8 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
17                 break;
18         case EXT4_GOING_FLAGS_NOLOGFLUSH:
19                 set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
20 -               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) {
21 -                       msleep(100);
22 +               if (sbi->s_journal && !is_journal_aborted(sbi->s_journal))
23                         jbd2_journal_abort(sbi->s_journal, 0);
24 -               }
25                 break;
26         default:
27                 return -EINVAL;