aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim2020-12-03 11:14:28 -0600
committerJaegeuk Kim2020-12-21 15:33:17 -0600
commitbe33871db7498910cc1df4ed52653aaf308bb671 (patch)
treec3f88b7530398b844a6a4f42836f8a79f0e0f556
parent317c4f58d6e31cfe26e86f734fb6288530acc637 (diff)
downloadkernel-be33871db7498910cc1df4ed52653aaf308bb671.tar.gz
kernel-be33871db7498910cc1df4ed52653aaf308bb671.tar.xz
kernel-be33871db7498910cc1df4ed52653aaf308bb671.zip
f2fs: don't allow any writes on readonly mount
generic_make_request: Trying to write to read-only block-device dm-5 (partno 0) WARNING: CPU: 7 PID: 546 at block/blk-core.c:2190 generic_make_request_checks+0x664/0x690 pc : generic_make_request_checks+0x664/0x690 lr : generic_make_request_checks+0x664/0x690 Call trace: generic_make_request_checks+0x664/0x690 generic_make_request+0xf0/0x3a4 submit_bio+0x80/0x250 __submit_merged_bio+0x368/0x4e0 __submit_merged_write_cond.llvm.12294350193007536502+0xe0/0x3e8 f2fs_wait_on_page_writeback+0x84/0x128 f2fs_convert_inline_page+0x35c/0x6f8 f2fs_convert_inline_inode+0xe0/0x2e0 f2fs_file_mmap+0x48/0x9c mmap_region+0x41c/0x74c do_mmap+0x40c/0x4fc vm_mmap_pgoff+0xb8/0x114 vm_mmap+0x34/0x48 elf_map+0x68/0x108 load_elf_binary+0x538/0xb70 search_binary_handler+0xac/0x1dc exec_binprm+0x50/0x15c __do_execve_file+0x620/0x740 __arm64_sys_execve+0x54/0x68 el0_svc_common+0x9c/0x168 el0_svc_handler+0x60/0x6c el0_svc+0x8/0xc Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/inline.c3
1 files changed, 2 insertions, 1 deletions
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)
188 struct page *ipage, *page; 188 struct page *ipage, *page;
189 int err = 0; 189 int err = 0;
190 190
191 if (!f2fs_has_inline_data(inode)) 191 if (!f2fs_has_inline_data(inode) ||
192 f2fs_hw_is_readonly(sbi) || f2fs_readonly(sbi->sb))
192 return 0; 193 return 0;
193 194
194 page = f2fs_grab_cache_page(inode->i_mapping, 0, false); 195 page = f2fs_grab_cache_page(inode->i_mapping, 0, false);