VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   57 Tags
author: Jaegeuk Kim <jaegeuk@kernel.org> 2020-12-03 09:14:28 -0800 committer: Jaegeuk Kim <jaegeuk@kernel.org> 2020-12-07 08:41:16 -0800 commit: ec2ddf499402a665d1f6f7f5ce1391100e54089e parent: a95ba66ac1457b76fe472c8e092ab1006271f16c
Commit Summary:
f2fs: don't allow any writes on readonly mount
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 92e9852d316a..d09a0bdc0197 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -188,7 +188,8 @@ int f2fs_convert_inline_inode(struct inode *inode)
 	struct page *ipage, *page;
 	int err = 0;
 
-	if (!f2fs_has_inline_data(inode))
+	if (!f2fs_has_inline_data(inode) ||
+			f2fs_hw_is_readonly(sbi) || f2fs_readonly(sbi->sb))
 		return 0;
 
 	page = f2fs_grab_cache_page(inode->i_mapping, 0, false);