diff options
author | Chao Yu <chao@kernel.org> | 2023-04-23 17:49:15 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-05-08 20:18:04 +0200 |
commit | b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5 (patch) | |
tree | 79d62b540aa2d60efe03d9f1f616274301ab4b6e /fs/f2fs/data.c | |
parent | Linux 6.4-rc1 (diff) | |
download | linux-b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5.tar.xz linux-b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5.zip |
f2fs: support errors=remount-ro|continue|panic mountoption
This patch supports errors=remount-ro|continue|panic mount option
for f2fs.
f2fs behaves as below in three different modes:
mode continue remount-ro panic
access ops normal noraml N/A
syscall errors -EIO -EROFS N/A
mount option rw ro N/A
pending dir write keep keep N/A
pending non-dir write drop keep N/A
pending node write drop keep N/A
pending meta write keep keep N/A
By default it uses "continue" mode.
[Yangtao helps to clean up function's name]
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 7165b1202f53..f26eac327d6e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2807,6 +2807,10 @@ int f2fs_write_single_data_page(struct page *page, int *submitted, if (S_ISDIR(inode->i_mode) && !is_sbi_flag_set(sbi, SBI_IS_CLOSE)) goto redirty_out; + + /* keep data pages in remount-ro mode */ + if (F2FS_OPTION(sbi).errors == MOUNT_ERRORS_READONLY) + goto redirty_out; goto out; } |