[f2fs-dev] [PATCH v3] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-19 Thread Wang Xiaojun
If the following process returns an error, the quota inode, not the quota file, is damaged. (fsck_chk_quota_node-->fsck_chk_node_blk-->sanity_check_nid) The fsck does not have a process to rebuild the quota inode. Because sanity_check_nid is not passed, fsck->nat_area_bitmap can not be cleared, an

Re: [f2fs-dev] [PATCH v2] f2fs: Reduce the scope of setting fsck tag when de->name_len is zero

2021-07-19 Thread Chao Yu
On 2021/7/19 18:14, Yangtao Li wrote: I recently found a case where de->name_len is 0 in f2fs_fill_dentries() easily reproduced, and finally set the fsck flag. Thread AThread B f2fs_readdir f2fs_read_inline_dir ctx->pos = d.max

Re: [f2fs-dev] [PATCH v2] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-19 Thread Chao Yu
On 2021/7/19 16:52, Wang Xiaojun wrote: If the following process returns an error, the quota inode, not the quota file, is damaged. (fsck_chk_quota_node-->fsck_chk_node_blk-->sanity_check_nid) The fsck does not have a process to rebuild the quota inode. Because sanity_check_nid is not passed, fs

Re: [f2fs-dev] [PATCH] f2fs: multidevice: support direct IO

2021-07-19 Thread Chao Yu
On 2021/7/20 2:28, Jaegeuk Kim wrote: On 07/19, Chao Yu wrote: Commit 3c62be17d4f5 ("f2fs: support multiple devices") missed to support direct IO for multiple device feature, this patch adds to support the missing part of multidevice feature. In addition, for multiple device image, we should be

Re: [f2fs-dev] [PATCH v3] f2fs: fix to force keeping write barrier for strict fsync mode

2021-07-19 Thread Chao Yu
On 2021/7/20 9:15, Jaegeuk Kim wrote: Wasn't it supposed to be v1? I skip IPU case for v1, and resend it as v3, is it fine to you? Thanks, On 07/20, Chao Yu wrote: [1] https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg15126.html As [1] reported, if lower device doesn

Re: [f2fs-dev] [PATCH v3] f2fs: fix to force keeping write barrier for strict fsync mode

2021-07-19 Thread Jaegeuk Kim
Wasn't it supposed to be v1? On 07/20, Chao Yu wrote: > [1] > https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg15126.html > > As [1] reported, if lower device doesn't support write barrier, in below > case: > > - write page #0; persist > - overwrite page #0 > - fsync > -

Re: [f2fs-dev] [PATCH v2] f2fs: let's keep writing IOs on SBI_NEED_FSCK

2021-07-19 Thread Chao Yu
On 2021/7/20 2:50, Jaegeuk Kim wrote: SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK, but do keep OPU. Fixes: 955772787667 ("f2fs: drop inpla

[f2fs-dev] [PATCH v3] f2fs: fix to force keeping write barrier for strict fsync mode

2021-07-19 Thread Chao Yu
[1] https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg15126.html As [1] reported, if lower device doesn't support write barrier, in below case: - write page #0; persist - overwrite page #0 - fsync - write data page #0 OPU into device's cache - write inode page into device'

Re: [f2fs-dev] [RFC NO MERGE] f2fs: extent cache: support unaligned extent

2021-07-19 Thread Chao Yu
On 2021/7/20 2:36, Jaegeuk Kim wrote: On 07/07, Chao Yu wrote: Compressed inode may suffer read performance issue due to it can not use extent cache, so I propose to add this unaligned extent support to improve it. Currently, it only works in readonly format f2fs image. Unaligned extent: in on

Re: [f2fs-dev] [PATCH] f2fs: reset free segment to prefree status when do_checkpoint() fail

2021-07-19 Thread Chao Yu
On 2021/7/20 2:25, Jaegeuk Kim wrote: On 07/19, Chao Yu wrote: On 2021/4/27 20:37, Chao Yu wrote: I think just reverting dirty/free bitmap is not enough if checkpoint fails, due to we have updated sbi->cur_cp_pack and nat/sit bitmap, next CP tries to overwrite last valid meta/node/data, then fi

Re: [f2fs-dev] [PATCH v2] f2fs: let's keep writing IOs on SBI_NEED_FSCK

2021-07-19 Thread Jaegeuk Kim
SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK, but do keep OPU. Fixes: 955772787667 ("f2fs: drop inplace IO if fs status is abnormal") Cc: #

Re: [f2fs-dev] [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK

2021-07-19 Thread Jaegeuk Kim
On 07/19, Chao Yu wrote: > On 2021/7/15 7:18, Jaegeuk Kim wrote: > > SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it > > is not fully critical to stop any IO writes. So, let's allow to write data > > instead of reporting EIO forever given SBI_NEED_FSCK. > > Well, it looks

Re: [f2fs-dev] [PATCH v2 RFC] f2fs: fix to force keeping write barrier for strict fsync mode

2021-07-19 Thread Jaegeuk Kim
On 07/14, Chao Yu wrote: > On 2021/7/14 10:19, Jaegeuk Kim wrote: > > On 07/14, Chao Yu wrote: > > > On 2021/7/14 7:34, Jaegeuk Kim wrote: > > > > On 07/13, Chao Yu wrote: > > > > > On 2021/7/8 1:48, Jaegeuk Kim wrote: > > > > > > On 07/02, Chao Yu wrote: > > > > > > > On 2021/7/2 9:32, Jaegeuk Kim

Re: [f2fs-dev] [RFC NO MERGE] f2fs: extent cache: support unaligned extent

2021-07-19 Thread Jaegeuk Kim
On 07/07, Chao Yu wrote: > Compressed inode may suffer read performance issue due to it can not > use extent cache, so I propose to add this unaligned extent support > to improve it. > > Currently, it only works in readonly format f2fs image. > > Unaligned extent: in one compressed cluster, physi

Re: [f2fs-dev] [PATCH] f2fs: multidevice: support direct IO

2021-07-19 Thread Jaegeuk Kim
On 07/19, Chao Yu wrote: > Commit 3c62be17d4f5 ("f2fs: support multiple devices") missed > to support direct IO for multiple device feature, this patch > adds to support the missing part of multidevice feature. > > In addition, for multiple device image, we should be aware of > any issued direct w

Re: [f2fs-dev] [PATCH] f2fs: reset free segment to prefree status when do_checkpoint() fail

2021-07-19 Thread Jaegeuk Kim
On 07/19, Chao Yu wrote: > On 2021/4/27 20:37, Chao Yu wrote: > > I think just reverting dirty/free bitmap is not enough if checkpoint fails, > > due to we have updated sbi->cur_cp_pack and nat/sit bitmap, next CP tries > > to overwrite last valid meta/node/data, then filesystem will be corrupted.

[f2fs-dev] [PATCH v2] f2fs: Reduce the scope of setting fsck tag when de->name_len is zero

2021-07-19 Thread Yangtao Li
I recently found a case where de->name_len is 0 in f2fs_fill_dentries() easily reproduced, and finally set the fsck flag. Thread AThread B f2fs_readdir f2fs_read_inline_dir ctx->pos = d.max

Re: [f2fs-dev] [PATCH v2] f2fs: compress: remove unneeded read when rewrite whole cluster

2021-07-19 Thread Chao Yu
On 2021/7/14 9:18, Chao Yu wrote: On 2021/7/14 7:44, Jaegeuk Kim wrote: On 07/13, Chao Yu wrote: On 2021/7/13 10:35, Fengnan Chang wrote: Hi Jaegeuk: Any comments about this version? On 2021/6/22 19:50, Fengnan Chang wrote: when we overwrite the whole page in cluster, we don't need r

Re: [f2fs-dev] [PATCH 6/9] f2fs: implement iomap operations

2021-07-19 Thread Christoph Hellwig
On Fri, Jul 16, 2021 at 09:39:16AM -0500, Eric Biggers wrote: > +static blk_qc_t f2fs_dio_submit_bio(struct inode *inode, struct iomap *iomap, > + struct bio *bio, loff_t file_offset) > +{ > + struct f2fs_private_dio *dio; > + bool write = (bio_op(bio) == REQ

Re: [f2fs-dev] [PATCH] f2fs: reset free segment to prefree status when do_checkpoint() fail

2021-07-19 Thread Chao Yu
On 2021/4/27 20:37, Chao Yu wrote: I think just reverting dirty/free bitmap is not enough if checkpoint fails, due to we have updated sbi->cur_cp_pack and nat/sit bitmap, next CP tries to overwrite last valid meta/node/data, then filesystem will be corrupted. So I suggest to set cp_error if do_c

[f2fs-dev] [PATCH] f2fs: multidevice: support direct IO

2021-07-19 Thread Chao Yu
Commit 3c62be17d4f5 ("f2fs: support multiple devices") missed to support direct IO for multiple device feature, this patch adds to support the missing part of multidevice feature. In addition, for multiple device image, we should be aware of any issued direct write IO rather than just buffered wri

[f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2021-07-19 Thread Chao Yu
xfstest generic/587 reports a deadlock issue as below: == WARNING: possible circular locking dependency detected 5.14.0-rc1 #69 Not tainted -- repquota/8606 is trying to acquire lock: 888022

[f2fs-dev] [PATCH v2] f2fs: fix wrong inflight page stats for directIO

2021-07-19 Thread Chao Yu
Previously, we use sbi->nr_pages[] to account direct IO, the count should be based on page granularity rather than bio granularity, fix it. Fixes: 02b16d0a34a1 ("f2fs: add to account direct IO") Signed-off-by: Chao Yu --- v2: - There is one missing line when I reorder in development patches, so j

[f2fs-dev] [PATCH v2] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-19 Thread Wang Xiaojun
If the following process returns an error, the quota inode, not the quota file, is damaged. (fsck_chk_quota_node-->fsck_chk_node_blk-->sanity_check_nid) The fsck does not have a process to rebuild the quota inode. Because sanity_check_nid is not passed, fsck->nat_area_bitmap can not be cleared, an

Re: [f2fs-dev] [PATCH 2/9] f2fs: remove allow_outplace_dio()

2021-07-19 Thread Christoph Hellwig
On Fri, Jul 16, 2021 at 09:39:12AM -0500, Eric Biggers wrote: > + do_opu = (rw == WRITE && f2fs_lfs_mode(sbi)); Nit: no need for the braces. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/list

[f2fs-dev] [PATCH] f2fs: fix wrong inflight page stats for directIO

2021-07-19 Thread Chao Yu
Previously, we use sbi->nr_pages[] to account direct IO, the count should be based on page granularity rather than bio granularity, fix it. Fixes: 02b16d0a34a1 ("f2fs: add to account direct IO") Signed-off-by: Chao Yu --- fs/f2fs/data.c | 10 ++ fs/f2fs/f2fs.h | 13 + 2 files

Re: [f2fs-dev] [PATCH] f2fs: let's keep writing IOs on SBI_NEED_FSCK

2021-07-19 Thread Chao Yu
On 2021/7/15 7:18, Jaegeuk Kim wrote: SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, so it is not fully critical to stop any IO writes. So, let's allow to write data instead of reporting EIO forever given SBI_NEED_FSCK. Well, it looks we need to check why there is SBI_NEED_