summaryrefslogtreecommitdiff
path: root/fs/ext4/inline.c
diff options
context:
space:
mode:
authorBaokun Li <libaokun1@huawei.com>2025-01-22 19:41:26 +0800
committerTheodore Ts'o <tytso@mit.edu>2025-03-13 10:16:34 -0400
commit0a1b2f5ea98764221ccc1043b8dc27a8c0225476 (patch)
tree715683e257162a67e33521799ab6b1222823b72e /fs/ext4/inline.c
parentf3054e53c2f367bd3cf6535afe9ab13198d2d739 (diff)
ext4: add ext4_emergency_state() helper function
Since both SHUTDOWN and EMERGENCY_RO are emergency states of the ext4 file system, and they are checked in similar locations, we have added a helper function, ext4_emergency_state(), to determine whether the current file system is in one of these two emergency states. Then, replace calls to ext4_forced_shutdown() with ext4_emergency_state() in those functions that could potentially trigger write operations. Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://patch.msgid.link/20250122114130.229709-4-libaokun@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inline.c')
-rw-r--r--fs/ext4/inline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index a651a033e518..6c3e8c8ccdf4 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -233,7 +233,7 @@ static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
struct ext4_inode *raw_inode;
int cp_len = 0;
- if (unlikely(ext4_forced_shutdown(inode->i_sb)))
+ if (unlikely(ext4_emergency_state(inode->i_sb)))
return;
BUG_ON(!EXT4_I(inode)->i_inline_off);