
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3 -------------------------------- This reverts commit f1128084b40e520bea8bb32b3ff4d03745ab7e64. We are about to revert 95257987a638 ("ext4: drop EXT4_MF_FS_ABORTED flag"), therefore the changes to the sb_rdonly check are being reverted here. Fixes: f1128084b40e ("ext4: drop read-only check in ext4_write_inode()") Signed-off-by: Baokun Li <libaokun1@huawei.com> --- fs/ext4/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f626f1c509c2..d28defcb2403 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5809,7 +5809,8 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) { int err; - if (WARN_ON_ONCE(current->flags & PF_MEMALLOC)) + if (WARN_ON_ONCE(current->flags & PF_MEMALLOC) || + sb_rdonly(inode->i_sb)) return 0; if (unlikely(ext4_forced_shutdown(inode->i_sb))) -- 2.46.1