Skip to content

Commit 8626441

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: handle readonly filesystem in f2fs_ioc_shutdown()
If mountpoint is readonly, we should allow shutdowning filesystem successfully, this fixes issue found by generic/599 testcase of xfstest. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent fc3bb09 commit 8626441

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fs/f2fs/file.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,8 +2232,15 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
22322232

22332233
if (in != F2FS_GOING_DOWN_FULLSYNC) {
22342234
ret = mnt_want_write_file(filp);
2235-
if (ret)
2235+
if (ret) {
2236+
if (ret == -EROFS) {
2237+
ret = 0;
2238+
f2fs_stop_checkpoint(sbi, false);
2239+
set_sbi_flag(sbi, SBI_IS_SHUTDOWN);
2240+
trace_f2fs_shutdown(sbi, in, ret);
2241+
}
22362242
return ret;
2243+
}
22372244
}
22382245

22392246
switch (in) {

0 commit comments

Comments
 (0)