summaryrefslogtreecommitdiff
path: root/fs/ext4/fsync.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-02-05 09:28:48 +0300
committerTheodore Ts'o <tytso@mit.edu>2017-02-05 09:28:48 +0300
commit0db1ff222d40f1601c961f0edb86d10426992595 (patch)
tree74c6613fb9f3fba41ff3fc90e0db69d9df20490c /fs/ext4/fsync.c
parent9549a168bd500db1a76914e50775f7cd1690acef (diff)
downloadlinux-0db1ff222d40f1601c961f0edb86d10426992595.tar.xz
ext4: add shutdown bit and check for it
Add a shutdown bit that will cause ext4 processing to fail immediately with EIO. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r--fs/ext4/fsync.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 88effb1053c7..9d549608fd30 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -100,6 +100,9 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
tid_t commit_tid;
bool needs_barrier = false;
+ if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
+ return -EIO;
+
J_ASSERT(ext4_journal_current_handle() == NULL);
trace_ext4_sync_file_enter(file, datasync);