aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-02-05 01:28:48 -0500
committerTheodore Ts'o <tytso@mit.edu>2017-02-05 01:28:48 -0500
commit0db1ff222d40f1601c961f0edb86d10426992595 (patch)
tree74c6613fb9f3fba41ff3fc90e0db69d9df20490c /fs/ext4/ialloc.c
parent9549a168bd500db1a76914e50775f7cd1690acef (diff)
downloadlinux-0db1ff222d40f1601c961f0edb86d10426992595.tar.gz
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/ialloc.c')
-rw-r--r--fs/ext4/ialloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index f372fc431b8e03..b14bae2598bc53 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -764,6 +764,9 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
if (!dir || !dir->i_nlink)
return ERR_PTR(-EPERM);
+ if (unlikely(ext4_forced_shutdown(EXT4_SB(dir->i_sb))))
+ return ERR_PTR(-EIO);
+
if ((ext4_encrypted_inode(dir) ||
DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) &&
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) {