summaryrefslogtreecommitdiff
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2018-02-18 23:45:18 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 09:36:30 +0200
commit73297f13a003b97e37a5648bbbecd45323cc0e24 (patch)
tree0bd249fff9462ca8637d6ab1ddfb9ee4070a8be4 /fs/ext4/ioctl.c
parent09439481998aefbe1bd6ae067079e738ba4a7a3f (diff)
ext4: pass -ESHUTDOWN code to jbd2 layer
commit fb7c02445c497943e7296cd3deee04422b63acb8 upstream. Previously the jbd2 layer assumed that a file system check would be required after a journal abort. In the case of the deliberate file system shutdown, this should not be necessary. Allow the jbd2 layer to distinguish between these two cases by using the ESHUTDOWN errno. Also add proper locking to __journal_abort_soft(). Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r--fs/ext4/ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 7f889b1e4db0..1eb68e626931 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -493,13 +493,13 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
if (sbi->s_journal && !is_journal_aborted(sbi->s_journal)) {
(void) ext4_force_commit(sb);
- jbd2_journal_abort(sbi->s_journal, 0);
+ jbd2_journal_abort(sbi->s_journal, -ESHUTDOWN);
}
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))
- jbd2_journal_abort(sbi->s_journal, 0);
+ jbd2_journal_abort(sbi->s_journal, -ESHUTDOWN);
break;
default:
return -EINVAL;