Re: [f2fs-dev] [PATCH v4 1/2] dump.f2fs: Add ability to dump folders

2024-05-30 Thread Jaegeuk Kim
On 05/29, Chao Yu wrote: > On 2024/5/24 6:46, Daniel Rosenberg wrote: > > This adds the ability to dump folders as well as files. Folders are > > dumped recursively. Additionally, dumped files/folders may be directed > > to a folder specified by -o [path] instead of ./lost_found. The -r flag > >

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: use per-log target_bitmap to improve lookup performace of ssr allocation

2024-05-30 Thread Jaegeuk Kim
On 05/29, Chao Yu wrote: > Ping, Chao, sorry, I might need some time to take a look at the change cautiously. > > On 2024/4/23 10:07, Chao Yu wrote: > > Jaegeuk, any comments for this serials? > > > > On 2024/4/11 16:23, Chao Yu wrote: > > > After commit 899fee36fac0 ("f2fs: fix to avoid data

Re: [f2fs-dev] Issue with f2fs on kernel 6.9.x

2024-05-28 Thread Jaegeuk Kim
Hi, We're aware of this issue, and the potential fix [1] was merged in 6.9.3-rc1 in https://lore.kernel.org/stable/zlt506xwtywg7...@duo.ucw.cz/T/#t Could you please check that patch addresses your problem? [1]

Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address

2024-05-23 Thread Jaegeuk Kim
Fixed the stable mailing list. On 05/23, Jaegeuk Kim wrote: > Hi Greg, > > Could you please consider to cherry-pick this patch in stable-6.9, since > there are many users suffering from unnecessary fsck runs during boot? > > You can get this from Linus's tree by > (b864ddb5

Re: [f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address

2024-05-23 Thread Jaegeuk Kim
Hi Greg, Could you please consider to cherry-pick this patch in stable-6.9, since there are many users suffering from unnecessary fsck runs during boot? You can get this from Linus's tree by (b864ddb57eb0 "f2fs: fix false alarm on invalid block address") Thanks, On 05/20, Jaegeuk

[f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address

2024-05-20 Thread Jaegeuk Kim
Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 5d05a413f451..55d444bec5c0 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -179,22 +179,22 @@ s

Re: [f2fs-dev] [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section

2024-05-20 Thread Jaegeuk Kim
On 05/17, Zhiguo Niu wrote: > commit 245930617c9b ("f2fs: fix to handle error paths of > {new,change}_curseg()") > missed this allocated path, fix it. > > Signed-off-by: Zhiguo Niu > --- > fs/f2fs/segment.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git

[f2fs-dev] [GIT PULL] f2fs update for 6.10-rc1

2024-05-20 Thread Jaegeuk Kim
direct io of pinned files for zoned storage f2fs: allow dirty sections with zero valid block for checkpoint disabled Jaegeuk Kim (5): f2fs: don't set RO when shutting down f2fs f2fs: use folio_test_writeback f2fs: assign the write hint per stream by default f2fs: clear

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-20 Thread Jaegeuk Kim
On 05/15, Chao Yu wrote: > On 2024/5/15 12:39, Jaegeuk Kim wrote: > > On 05/15, Chao Yu wrote: > > > On 2024/5/15 0:07, Jaegeuk Kim wrote: > > > > 外部邮件/External Mail > > > > > > > > > > > > On 05/11, Chao Yu wrote: > > &

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-05-14 Thread Jaegeuk Kim
On 05/15, Chao Yu wrote: > On 2024/5/15 0:09, Jaegeuk Kim wrote: > > On 05/10, Chao Yu wrote: > > > If lfs mode is on, buffered read may race w/ OPU dio write as below, > > > it may cause buffered read hits unwritten data unexpectly, and for > > > dio rea

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-14 Thread Jaegeuk Kim
On 05/15, Chao Yu wrote: > On 2024/5/15 0:07, Jaegeuk Kim wrote: > > 外部邮件/External Mail > > > > > > On 05/11, Chao Yu wrote: > > > On 2024/5/11 8:38, Jaegeuk Kim wrote: > > > > On 05/10, Chao Yu wrote: > > > > > On 2024/5/1

Re: [f2fs-dev] [PATCH v2] f2fs: fix to avoid racing in between read and OPU dio write

2024-05-14 Thread Jaegeuk Kim
On 05/10, Chao Yu wrote: > If lfs mode is on, buffered read may race w/ OPU dio write as below, > it may cause buffered read hits unwritten data unexpectly, and for > dio read, the race condition exists as well. > > Thread A Thread B > - f2fs_file_write_iter > -

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-14 Thread Jaegeuk Kim
On 05/11, Chao Yu wrote: > On 2024/5/11 8:38, Jaegeuk Kim wrote: > > On 05/10, Chao Yu wrote: > > > On 2024/5/10 11:36, Jaegeuk Kim wrote: > > > > On 05/10, Chao Yu wrote: > > > > > On 2024/5/9 23:52, Jaegeuk Kim wrote: > > > > > > O

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-10 Thread Jaegeuk Kim
On 05/10, Chao Yu wrote: > On 2024/5/10 11:36, Jaegeuk Kim wrote: > > On 05/10, Chao Yu wrote: > > > On 2024/5/9 23:52, Jaegeuk Kim wrote: > > > > On 05/06, Chao Yu wrote: > > > > > syzbot reports a f2fs bug as below: > > > > > > &g

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-09 Thread Jaegeuk Kim
On 05/10, Chao Yu wrote: > On 2024/5/9 23:52, Jaegeuk Kim wrote: > > On 05/06, Chao Yu wrote: > > > syzbot reports a f2fs bug as below: > > > > > > [ cut here ] > > > kernel BUG at fs/f2fs/inline.c:258! > > > CPU: 1 P

Re: [f2fs-dev] [PATCH] f2fs: allow dirty sections with zero valid block for checkpoint disabled

2024-05-09 Thread Jaegeuk Kim
On 05/07, Daeho Jeong wrote: > From: Daeho Jeong > > Following the semantic for dirty segments in checkpoint disabled mode, > apply the same rule to dirty sections. > > Signed-off-by: Daeho Jeong > --- > fs/f2fs/segment.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix to do sanity check on i_nid for inline_data inode

2024-05-09 Thread Jaegeuk Kim
On 05/06, Chao Yu wrote: > syzbot reports a f2fs bug as below: > > [ cut here ] > kernel BUG at fs/f2fs/inline.c:258! > CPU: 1 PID: 34 Comm: kworker/u8:2 Not tainted > 6.9.0-rc6-syzkaller-00012-g9e4bc4bcae01 #0 > RIP: 0010:f2fs_write_inline_data+0x781/0x790

Re: [f2fs-dev] [PATCH 2/3] f2fs: fix to add missing iput() in gc_data_segment()

2024-05-09 Thread Jaegeuk Kim
On 05/09, Chao Yu wrote: > On 2024/5/9 8:46, Jaegeuk Kim wrote: > > On 05/06, Chao Yu wrote: > > > During gc_data_segment(), if inode state is abnormal, it missed to call > > > iput(), fix it. > > > > > > Fixes: 132e3209789c ("f2fs: remove f

Re: [f2fs-dev] [PATCH 2/3] f2fs: fix to add missing iput() in gc_data_segment()

2024-05-08 Thread Jaegeuk Kim
On 05/06, Chao Yu wrote: > During gc_data_segment(), if inode state is abnormal, it missed to call > iput(), fix it. > > Fixes: 132e3209789c ("f2fs: remove false alarm on iget failure during GC") > Fixes: 9056d6489f5a ("f2fs: fix to do sanity check on inode type during > garbage collection") >

Re: [f2fs-dev] [PATCH] f2fs: fix block migration when section is not aligned to pow2

2024-04-29 Thread Jaegeuk Kim
On 04/29, Jaegeuk Kim wrote: > On 04/26, Wu Bo wrote: > > As for zoned-UFS, f2fs section size is forced to zone size. And zone > > size may not aligned to pow2. > > > > Fixes: 859fca6b706e ("f2fs: swap: support migrating swapfile in aligned > > write m

Re: [f2fs-dev] [PATCH] f2fs: fix block migration when section is not aligned to pow2

2024-04-29 Thread Jaegeuk Kim
On 04/26, Wu Bo wrote: > As for zoned-UFS, f2fs section size is forced to zone size. And zone > size may not aligned to pow2. > > Fixes: 859fca6b706e ("f2fs: swap: support migrating swapfile in aligned write > mode") > Signed-off-by: Liao Yuanhong > Signed-off-by: Wu Bo > --- > fs/f2fs/data.c

[f2fs-dev] [PATCH] f2fs: fix false alarm on invalid block address

2024-04-24 Thread Jaegeuk Kim
f2fs_ra_meta_pages can try to read ahead on invalid block address which is not the corruption case. Cc: # v6.9+ Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218770 Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr") Signed-off-by: Jaegeuk Kim --

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix false alarm on invalid block address

2024-04-19 Thread Jaegeuk Kim
On 04/19, Juhyung Park wrote: > On Sat, Apr 13, 2024 at 5:57 AM Jaegeuk Kim wrote: > > > > On 04/11, Chao Yu wrote: > > > On 2024/4/10 4:34, Jaegeuk Kim wrote: > > > > f2fs_ra_meta_pages can try to read ahead on invalid block address which > &

Re: [f2fs-dev] [PATCH] f2fs: assign the write hint per stream by default

2024-04-19 Thread Jaegeuk Kim
On 04/18, Chao Yu wrote: > On 2024/4/18 5:12, Jaegeuk Kim wrote: > > This reverts commit 930e2607638d ("f2fs: remove obsolete whint_mode"), as we > > decide to pass write hints to the disk. > > > > Signed-off-by: Jaegeuk Kim > > --- &g

Re: [f2fs-dev] [PATCH] f2fs: assign write hint in direct write IO path

2024-04-19 Thread Jaegeuk Kim
Thanks, Chao, If you don't mind, can I merge this into my patch. Ok? On 04/18, Chao Yu wrote: > f2fs has its own write_hint policy, let's assign write hint for > direct write bio. > > Cc: Hyunchul Lee > Signed-off-by: Chao Yu > --- > fs/f2fs/f2fs.h| 1 + > fs/f2fs/file.c| 15

[f2fs-dev] [PATCH] f2fs: assign the write hint per stream by default

2024-04-17 Thread Jaegeuk Kim
This reverts commit 930e2607638d ("f2fs: remove obsolete whint_mode"), as we decide to pass write hints to the disk. Signed-off-by: Jaegeuk Kim --- Documentation/filesystems/f2fs.rst | 29 +++ fs/f2fs/data.c | 2 + fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH] f2fs:add zone device priority option to the mount options

2024-04-16 Thread Jaegeuk Kim
I don't see any point why we need this. On 04/15, Liao Yuanhong wrote: > Add a zone device priority option in the mount options. When enabled, the > file system will prioritize using zone devices free space instead of > conventional devices when writing to the end of the storage space. > >

Re: [f2fs-dev] [PATCH v3] f2fs: zone: don't block IO if there is remained open zone

2024-04-16 Thread Jaegeuk Kim
On 04/16, Chao Yu wrote: > On 2024/4/15 22:01, Chao Yu wrote: > > On 2024/4/15 11:26, Chao Yu wrote: > > > On 2024/4/14 23:19, Jaegeuk Kim wrote: > > > > It seems this caused kernel hang. Chao, have you tested this patch > > > > enough? > >

Re: [f2fs-dev] [PATCH 2/3 v2] f2fs: clear writeback when compression failed

2024-04-16 Thread Jaegeuk Kim
Let's stop issuing compressed writes and clear their writeback flags. Signed-off-by: Jaegeuk Kim --- Now, I don't see any kernel hang for 24hours. Change log from v1: - fix bugs fs/f2fs/compress.c | 40 ++-- 1 file changed, 38 insertions(+), 2

Re: [f2fs-dev] [PATCH v3] f2fs: zone: don't block IO if there is remained open zone

2024-04-14 Thread Jaegeuk Kim
It seems this caused kernel hang. Chao, have you tested this patch enough? On 04/13, Chao Yu wrote: > On 2024/4/13 5:11, Jaegeuk Kim wrote: > > On 04/07, Chao Yu wrote: > > > max open zone may be larger than log header number of f2fs, for > > > such case, it d

Re: [f2fs-dev] [PATCH v3] f2fs: zone: don't block IO if there is remained open zone

2024-04-12 Thread Jaegeuk Kim
On 04/07, Chao Yu wrote: > max open zone may be larger than log header number of f2fs, for > such case, it doesn't need to wait last IO in previous zone, let's > introduce available_open_zone semaphore, and reduce it once we > submit first write IO in a zone, and increase it after completion > of

Re: [f2fs-dev] [PATCH 2/3] f2fs: clear writeback when compression failed

2024-04-12 Thread Jaegeuk Kim
On 04/11, Chao Yu wrote: > On 2024/4/10 4:34, Jaegeuk Kim wrote: > > Let's stop issuing compressed writes and clear their writeback flags. > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/compress.c | 33 +++-- > >

Re: [f2fs-dev] [PATCH 3/3] f2fs: fix false alarm on invalid block address

2024-04-12 Thread Jaegeuk Kim
On 04/11, Chao Yu wrote: > On 2024/4/10 4:34, Jaegeuk Kim wrote: > > f2fs_ra_meta_pages can try to read ahead on invalid block address which is > > not the corruption case. > > In which case we will read ahead invalid meta pages? recovery w/ META_POR? I was trying t

Re: [f2fs-dev] [PATCH V3] f2fs: add REQ_TIME time update for some user behaviors

2024-04-12 Thread Jaegeuk Kim
On 04/10, Zhiguo Niu wrote: > Hi Jaegeuk > Any comments about this patch? Thank you for heads up. Applied. > thanks! > > On Wed, Mar 20, 2024 at 5:33 PM Chao Yu wrote: > > > > On 2024/3/20 14:22, Zhiguo Niu wrote: > > > some user behaviors requested filesystem operations, which > > > will

Re: [f2fs-dev] 回覆: 回覆: 回覆: [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-04-12 Thread Jaegeuk Kim
On 04/12, Light Hsieh (謝明燈) wrote: > I think 'readon' in this line may be typo of 'reason' Was fixed as well. Thanks. > > + f2fs_warn(sbi, "Stopped filesystem due to readon: %d", reason); > > > > 寄件者: Jaegeuk Kim > 寄件日期: 2024年4月5日 上午 03:55 >

Re: [f2fs-dev] [PATCH] resize.f2fs: get value from new sb during rebuilding cp

2024-04-09 Thread Jaegeuk Kim
On 04/09, Sheng Yong wrote: > > > On 2024/4/9 2:34, Jaegeuk Kim wrote: > > On 04/08, Sheng Yong wrote: > > > Althrough old and new sb have the same value for now, it would be better > > > to build new checkpoint according to new sb. > > > >

[f2fs-dev] [PATCH 3/3] f2fs: fix false alarm on invalid block address

2024-04-09 Thread Jaegeuk Kim
f2fs_ra_meta_pages can try to read ahead on invalid block address which is not the corruption case. Fixes: 31f85ccc84b8 ("f2fs: unify the error handling of f2fs_is_valid_blkaddr") Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 9 + 1 file changed, 5 insertions(+), 4

[f2fs-dev] [PATCH 1/3] f2fs: use folio_test_writeback

2024-04-09 Thread Jaegeuk Kim
Let's convert PageWriteback to folio_test_writeback. Signed-off-by: Jaegeuk Kim --- fs/f2fs/compress.c | 2 +- fs/f2fs/data.c | 3 +-- fs/f2fs/f2fs.h | 2 +- fs/f2fs/gc.c | 2 +- fs/f2fs/inline.c | 2 +- fs/f2fs/inode.c| 3 ++- fs/f2fs/node.c | 2 +- fs/f2fs

[f2fs-dev] [PATCH 2/3] f2fs: clear writeback when compression failed

2024-04-09 Thread Jaegeuk Kim
Let's stop issuing compressed writes and clear their writeback flags. Signed-off-by: Jaegeuk Kim --- fs/f2fs/compress.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index d67c471ab5df..3a8ecc6aee84

Re: [f2fs-dev] [PATCH] f2fs: don't set RO when shutting down f2fs

2024-04-09 Thread Jaegeuk Kim
On 04/09, Chao Yu wrote: > On 2024/4/5 3:52, Jaegeuk Kim wrote: > > Shutdown does not check the error of thaw_super due to readonly, which > > causes a deadlock like below. > > > > f2fs_ioc_shutdown(F2FS_GOING_DOWN_FULLSYNC)issue_discard_thread > > -

Re: [f2fs-dev] [PATCH v2] f2fs: don't set RO when shutting down f2fs

2024-04-09 Thread Jaegeuk Kim
- sb_start_write - set RO - waiting - bdev_thaw - thaw_super_locked - return -EINVAL, if sb_rdonly() - f2fs_stop_discard_thread -> wait for kthread_stop(discard_thread); Reported-by: "Light Hsieh (謝明燈)" Signed-off-by: Jaegeuk Kim --- Chang

Re: [f2fs-dev] [PATCH] resize.f2fs: get value from new sb during rebuilding cp

2024-04-08 Thread Jaegeuk Kim
On 04/08, Sheng Yong wrote: > Althrough old and new sb have the same value for now, it would be better > to build new checkpoint according to new sb. May need to add assert, if they're different? > > Signed-off-by: Sheng Yong > --- > fsck/resize.c | 7 --- > 1 file changed, 4

Re: [f2fs-dev] 回覆: 回覆: [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-04-04 Thread Jaegeuk Kim
deactivate_locked_super(sb); >   return 0; > } Thank you. Could you please take a look at this patch? https://lore.kernel.org/linux-f2fs-devel/20240404195254.556896-1-jaeg...@kernel.org/T/#u > > 寄件者: Jaegeuk Kim > 寄件日期: 2024年3月27日 上午 12:52 > 收件者: Light Hsieh

[f2fs-dev] [PATCH] f2fs: don't set RO when shutting down f2fs

2024-04-04 Thread Jaegeuk Kim
- sb_start_write - set RO - waiting - bdev_thaw - thaw_super_locked - return -EINVAL, if sb_rdonly() - f2fs_stop_discard_thread -> wait for kthread_stop(discard_thread); Reported-by: "Light Hsieh (謝明燈)" Signed-off-by: Jaegeuk Kim --- fs/f2fs

[f2fs-dev] [PATCH] f2fs-tools: give 6 sections for overprovision buffer

2024-04-02 Thread Jaegeuk Kim
This addresses high GC cost at runtime. Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 8 +++- mkfs/f2fs_format.c | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index fc56396fa358..870a6e4823d2 100644 --- a/include

Re: [f2fs-dev] 回覆: [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-26 Thread Jaegeuk Kim
On 03/22, Jaegeuk Kim wrote: > On 03/22, Light Hsieh (謝明燈) wrote: > > I don't see my added log in sb_free_unlock() which will invoke > > percpu_up_write to release the write semaphore. > > May I ask more details whether thaw_super() was

Re: [f2fs-dev] 回覆: [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-22 Thread Jaegeuk Kim
On 03/22, Light Hsieh (謝明燈) wrote: > I don't see my added log in sb_free_unlock() which will invoke > percpu_up_write to release the write semaphore. May I ask more details whether thaw_super() was called or not? > > > ____ > 寄件者: Jaegeuk Kim >

Re: [f2fs-dev] 回覆: 回覆: f2fs F2FS_IOC_SHUTDOWN hang issue

2024-03-21 Thread Jaegeuk Kim
code flow goto the line: >   } while (!kthread_should_stop()); > Since kthrad_should_stop() is true now, so the issue_discard_thread will end? Yes, but now I'm confused who is taking write_sem. :( > > Light > ________ > 寄件者: Jaegeuk Kim > 寄件日期: 2024年3月21日 上午

Re: [f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-21 Thread Jaegeuk Kim
On 03/22, Hillf Danton wrote: > On Tue, 19 Mar 2024 17:14:42 -0700 Jaegeuk Kim > > f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC) issue_discard_thread > > - mnt_want_write_file() > >- sb_start_write(SB_FREEZE_WRITE) >__sb_start_write() >

Re: [f2fs-dev] 回覆: f2fs F2FS_IOC_SHUTDOWN hang issue

2024-03-20 Thread Jaegeuk Kim
On 03/20, Light Hsieh (謝明燈) wrote: > On 2024/3/20 8:14, Jaegeuk Kim wrote: > > f2fs_ioc_shutdown(F2FS_GOING_DOWN_NOSYNC)  issue_discard_thread > >   - mnt_want_write_file() > >     - sb_start_write(SB_FREEZE_WRITE) > >                                            

Re: [f2fs-dev] f2fs F2FS_IOC_SHUTDOWN hang issue

2024-03-20 Thread Jaegeuk Kim
Can you try this? https://patchwork.kernel.org/project/f2fs/patch/20240320001442.497813-1-jaeg...@kernel.org/ On 03/20, Light Hsieh (謝明燈) wrote: > Hi Jaegeuk: > > We encounter a deadlock issue when Android is going to poweroff. > Please help check. > > When unmounting of f2fs partition fail

[f2fs-dev] [PATCH] f2fs: avoid the deadlock case when stopping discard thread

2024-03-19 Thread Jaegeuk Kim
); - f2fs_stop_discard_thread(sbi); - kthread_stop() : waiting - mnt_drop_write_file(filp); Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 4fd76e867e0a..088b8c48cffa 100644

[f2fs-dev] [GIT PULL] f2fs update for 6.9-rc1

2024-03-18 Thread Jaegeuk Kim
: support file pinning for zoned devices f2fs: prevent atomic write on pinned file HuangXiaojia (1): f2fs: Use folio in f2fs_read_merkle_tree_page Jaegeuk Kim (10): f2fs: remove unnecessary f2fs_put_page in f2fs_rename f2fs: deprecate io_bits f2fs: use BLKS_PER_SEG

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid use-after-free issue in f2fs_filemap_fault

2024-03-14 Thread Jaegeuk Kim
On 03/14, Chao Yu wrote: > syzbot reports a f2fs bug as below: > > BUG: KASAN: slab-use-after-free in f2fs_filemap_fault+0xd1/0x2c0 > fs/f2fs/file.c:49 > Read of size 8 at addr 88807bb22680 by task syz-executor184/5058 > > CPU: 0 PID: 5058 Comm: syz-executor184 Not tainted >

Re: [f2fs-dev] [PATCH] f2fs: fix to return EIO when reading after device removal

2024-03-12 Thread Jaegeuk Kim
n 2024/2/19 11:13, Chao Yu wrote: > > > On 2024/2/8 8:18, Jaegeuk Kim wrote: > > > > On 02/06, Chao Yu wrote: > > > > > generic/730 2s ... - output mismatch (see > > > > > /media/fstests/results//generic/730.out.bad) > > > > > --

Re: [f2fs-dev] [PATCH] f2fs: support .shutdown in f2fs_sops

2024-03-12 Thread Jaegeuk Kim
Will check this after merge window. On 03/12, Chao Yu wrote: > Ping, > > On 2024/2/29 22:38, Chao Yu wrote: > > Support .shutdown callback in f2fs_sops, then, it can be called to > > shut down the file system when underlying block device is marked dead. > > > > Signed-off-by: Chao Yu > > --- >

Re: [f2fs-dev] [syzbot] [f2fs?] KASAN: slab-use-after-free Read in f2fs_filemap_fault

2024-03-12 Thread Jaegeuk Kim
On 03/12, Ed Tsai (蔡宗軒) wrote: > On Mon, 2024-01-15 at 20:05 +0800, Hillf Danton wrote: > > > > ... > > > > --- x/fs/f2fs/file.c > > +++ y/fs/f2fs/file.c > > @@ -39,6 +39,7 @@ > > static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf) > > { > > struct inode *inode =

Re: [f2fs-dev] [PATCH] f2fs: Cast expression type to unsigned long in __count_extent_cache()

2024-03-11 Thread Jaegeuk Kim
On 03/10, David Laight wrote: > From: Roman Smirnov > > Sent: 05 March 2024 08:10 > > > > Cast expression type to unsigned long in __count_extent_cache() > > to prevent integer overflow. > > > > Found by Linux Verification Center (linuxtesting.org) with Svace. > > Another broken analysis tool

Re: [f2fs-dev] [PATCH] f2fs: fix to truncate meta inode pages forcely

2024-03-07 Thread Jaegeuk Kim
On 03/07, Chao Yu wrote: > Below race case can cause data corruption: > > Thread A GC thread > - f2fs_inplace_write_data > - gc_data_segment >- ra_data_block >

Re: [f2fs-dev] [PATCH v2] f2fs: add a proc entry show disk map

2024-03-05 Thread Jaegeuk Kim
This patch adds the disk map of block address ranges configured by multiple partitions. Signed-off-by: Jaegeuk Kim --- from v1: - add more layout information fs/f2fs/sysfs.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/fs/f2fs/sysfs.c

Re: [f2fs-dev] [External Mail]Re: [PATCH v3] f2fs-tools: fix to check loop device for non-root users

2024-03-05 Thread Jaegeuk Kim
On 03/01, 黄佳男 wrote: > On 2024/3/1 16:39, Juhyung Park wrote: > > [外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给mi...@xiaomi.com进行反馈 > > > > Hi Huang and Chao. > > > > I feel like this special loopback handling alongside Chao's > > 14197d546b93 on f2fs-tools is just unnecessarily complicating the

[f2fs-dev] [PATCH] f2fs-tools: deal with permission denial on non-root user

2024-03-05 Thread Jaegeuk Kim
This fixes some android build failures due to the missing permission when checking the loop device. Until we get a better solution, let's ignore the error with warnings. Signed-off-by: Jaegeuk Kim --- lib/libf2fs.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git

[f2fs-dev] [PATCH] f2fs: add a proc entry show disk map

2024-03-04 Thread Jaegeuk Kim
This patch adds the disk map of block address ranges configured by multiple partitions. Signed-off-by: Jaegeuk Kim --- fs/f2fs/sysfs.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 10f308b3128f..e81af6adb85b 100644 --- a/fs

Re: [f2fs-dev] [PATCH 3/5] f2fs: print zone status in string and some log

2024-03-04 Thread Jaegeuk Kim
On 02/23, Jaegeuk Kim wrote: > No functional change, but add some more logs. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/segment.c | 34 -- > fs/f2fs/super.c | 1 + > 2 files changed, 25 insertions(+), 10 deletions(-) > > diff

Re: [f2fs-dev] [PATCH 1/4] f2fs: fix blkofs_end correctly in f2fs_migrate_blocks()

2024-02-29 Thread Jaegeuk Kim
On 03/01, Chao Yu wrote: > On 2024/3/1 1:41, Daeho Jeong wrote: > > On Thu, Feb 29, 2024 at 2:11 AM Chao Yu wrote: > > > > > > Jaegeuk, Daeho, > > > > > > Any comments on this serials? > > > > > > Thanks, > > > > No functional difference here, since start_blk is always aligned with > > the

Re: [f2fs-dev] [PATCH] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

2024-02-29 Thread Jaegeuk Kim
On 03/01, Chao Yu wrote: > On 2024/3/1 0:35, Jaegeuk Kim wrote: > > On 02/29, Chao Yu wrote: > > > On 2024/2/28 1:47, Jaegeuk Kim wrote: > > > > On 02/21, Chao Yu wrote: > > > > > Just cleanup, no functional change. > > > > > > >

Re: [f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Jaegeuk Kim
On 02/29, Colin King (gmail) wrote: > On 29/02/2024 17:12, Jaegeuk Kim wrote: > > Hi Colin, > > > > Thank you for the fix. If you don't mind, can I integrate this fix > > into the original patch? > > Sure. No problem. Thank you so much! > > Colin > &

Re: [f2fs-dev] [PATCH][next] f2fs: Fix two spelling mistakes in f2fs_zone_status array

2024-02-29 Thread Jaegeuk Kim
Hi Colin, Thank you for the fix. If you don't mind, can I integrate this fix into the original patch? Thanks, On 02/29, Colin Ian King wrote: > The array f2fs_zone_status contains two spelling mistakes in > literal strings. Fix them. > > Signed-off-by: Colin Ian King > --- >

Re: [f2fs-dev] [PATCH] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

2024-02-29 Thread Jaegeuk Kim
On 02/29, Chao Yu wrote: > On 2024/2/28 1:47, Jaegeuk Kim wrote: > > On 02/21, Chao Yu wrote: > > > Just cleanup, no functional change. > > > > > > Signed-off-by: Chao Yu > > > --- > > > fs/f2fs/debug.c | 7 +++ > > > fs/f2

Re: [f2fs-dev] [PATCH 2/4] f2fs: fix to don't call f2fs_stop_checkpoint in spinlock coverage

2024-02-27 Thread Jaegeuk Kim
On 02/22, Chao Yu wrote: > f2fs_stop_checkpoint(, false) is complex and it may sleep, so we should > move it outside segmap_lock spinlock coverage in get_new_segment(). Chao, I merged this patch into

Re: [f2fs-dev] [PATCH] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

2024-02-27 Thread Jaegeuk Kim
On 02/21, Chao Yu wrote: > Just cleanup, no functional change. > > Signed-off-by: Chao Yu > --- > fs/f2fs/debug.c | 7 +++ > fs/f2fs/f2fs.h| 14 -- > fs/f2fs/gc.c | 10 +- > fs/f2fs/gc.h | 4 ++-- > fs/f2fs/segment.c | 12 ++-- >

Re: [f2fs-dev] [bug report] f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and SEGS_PER_SEC

2024-02-27 Thread Jaegeuk Kim
On 02/27, Dan Carpenter wrote: > Hello Jaegeuk Kim, > > The patch 9c1d3cd4ff8c: "f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and > SEGS_PER_SEC" from Feb 6, 2024 (linux-next), leads to the following > Smatch static checker warning: > > fs/f2fs/gc.c:2092 update_f

Re: [f2fs-dev] [bug report] f2fs: stop checkpoint when get a out-of-bounds segment

2024-02-27 Thread Jaegeuk Kim
Hi, I merged two patches, which addresses this. f2fs: stop checkpoint when get a out-of-bounds segment f2fs: fix to don't call f2fs_stop_checkpoint in spinlock coverage On 02/27, Dan Carpenter wrote: > Hello Zhiguo Niu, > > The patch 7a0392932f97: "f2fs: stop checkpoint when get a >

Re: [f2fs-dev] [PATCH v2 0/4] f2fs: fix panic issue in small capacity device

2024-02-27 Thread Jaegeuk Kim
On 02/27, Zhiguo Niu wrote: > On Tue, Feb 27, 2024 at 9:13 AM Jaegeuk Kim wrote: > > > > On 02/26, Zhiguo Niu wrote: > > > Dear Chao, > > > > > > On Fri, Feb 23, 2024 at 10:38 AM Chao Yu wrote: > > > > > > > > On 2024/2/23 10:

Re: [f2fs-dev] [PATCH v2 0/4] f2fs: fix panic issue in small capacity device

2024-02-26 Thread Jaegeuk Kim
On 02/26, Zhiguo Niu wrote: > Dear Chao, > > On Fri, Feb 23, 2024 at 10:38 AM Chao Yu wrote: > > > > On 2024/2/23 10:01, Zhiguo Niu wrote: > > > > > > > > > On Thu, Feb 22, 2024 at 8:30 PM Chao Yu > > > wrote: > > > > > > On 2024/2/7 10:01, Zhiguo Niu wrote: > > >

Re: [f2fs-dev] [PATCH 2/5] f2fs: fix write pointers all the time

2024-02-26 Thread Jaegeuk Kim
On 02/26, Chao Yu wrote: > On 2024/2/24 4:55, Jaegeuk Kim wrote: > > Even if the roll forward recovery stopped due to any error, we have to fix > > the write pointers in order to mount the disk from the previous checkpoint. > > Jaegeuk, > > IIUC, we may lost warm node

Re: [f2fs-dev] [PATCH 2/5 v2] f2fs: fix write pointers all the time

2024-02-26 Thread Jaegeuk Kim
Even if the roll forward recovery stopped due to any error, we have to fix the write pointers in order to mount the disk from the previous checkpoint. Signed-off-by: Jaegeuk Kim --- from v1: - preserve error fs/f2fs/recovery.c | 15 +++ fs/f2fs/super.c| 11 +++ 2

Re: [f2fs-dev] [PATCH 1/5 v2] f2fs: check number of blocks in a current section

2024-02-26 Thread Jaegeuk Kim
In cfd66bb715fd ("f2fs: fix deadloop in foreground GC"), we needed to check the number of blocks in a section instead of the segment. Fixes: cfd66bb715fd ("f2fs: fix deadloop in foreground GC") Signed-off-by: Jaegeuk Kim --- from v1: - check current node block space to

Re: [f2fs-dev] [PATCH 3/5 v2] f2fs: print zone status in string and some log

2024-02-26 Thread Jaegeuk Kim
No functional change, but add some more logs. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- from v1: - avoid unnecessary log per Daeho's comment fs/f2fs/segment.c | 27 +-- fs/f2fs/super.c | 1 + 2 files changed, 22 insertions(+), 6 deletions(-) diff

Re: [f2fs-dev] [PATCH 5/5] f2fs: allow to mount if cap is 100

2024-02-26 Thread Jaegeuk Kim
On 02/26, Daeho Jeong wrote: > On Fri, Feb 23, 2024 at 12:56 PM Jaegeuk Kim wrote: > > > > Don't block mounting the partition, if cap is 100%. > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/segment.c | 3 +++ > > 1 file changed, 3 insertion

Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: should give section-aligned reserved segments

2024-02-23 Thread Jaegeuk Kim
The reserved segments should be aligned to the section boundary. Signed-off-by: Jaegeuk Kim --- v2: - fix bug include/f2fs_fs.h | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 9056e02acd29..fc56396fa358 100644

[f2fs-dev] [PATCH] mkfs.f2fs: should give section-aligned reserved segments

2024-02-23 Thread Jaegeuk Kim
The reserved segments should be aligned to the section boundary. Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 9056e02acd29..2e93503cada9 100644 --- a/include/f2fs_fs.h +++ b

[f2fs-dev] [PATCH 5/5] f2fs: allow to mount if cap is 100

2024-02-23 Thread Jaegeuk Kim
Don't block mounting the partition, if cap is 100%. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6d586ae8b55f..f11361152d2a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -904,6

[f2fs-dev] [PATCH 4/5] f2fs: prevent an f2fs_gc loop during disable_checkpoint

2024-02-23 Thread Jaegeuk Kim
Don't get stuck in the f2fs_gc loop while disabling checkpoint. Instead, we have a time-based management. Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index fc7f1a9fbbda..7d9b92978709 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH 2/5] f2fs: fix write pointers all the time

2024-02-23 Thread Jaegeuk Kim
Even if the roll forward recovery stopped due to any error, we have to fix the write pointers in order to mount the disk from the previous checkpoint. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 2 +- fs/f2fs/super.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff

[f2fs-dev] [PATCH 3/5] f2fs: print zone status in string and some log

2024-02-23 Thread Jaegeuk Kim
No functional change, but add some more logs. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 34 -- fs/f2fs/super.c | 1 + 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d4f228e6f771

[f2fs-dev] [PATCH 1/5] f2fs: check number of blocks in a current section

2024-02-23 Thread Jaegeuk Kim
y we don't have exact dirty page count per temperature. Hence, use a rough estimation. Fixes: cfd66bb715fd ("f2fs: fix deadloop in foreground GC") Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a

Re: [f2fs-dev] [PATCH] f2fs: fix to use correct segment type in f2fs_allocate_data_block()

2024-02-23 Thread Jaegeuk Kim
On 02/23, Chao Yu wrote: > @type in f2fs_allocate_data_block() indicates log header's type, it > can be CURSEG_COLD_DATA_PINNED or CURSEG_ALL_DATA_ATGC, rather than > type of data/node, however IS_DATASEG()/IS_NODESEG() only accept later > one, fix it. > > Fixes: 093749e296e2 ("f2fs: support age

Re: [f2fs-dev] [PATCH] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

2024-02-23 Thread Jaegeuk Kim
Chao, I applied the below as well in order to keep zone capacity back. --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -101,11 +101,10 @@ static inline void sanity_check_seg_type(struct f2fs_sb_info *sbi, NULL_SEGNO : GET_L2R_SEGNO(FREE_I(sbi), \

Re: [f2fs-dev] [PATCH 3/3 v2] f2fs: kill zone-capacity support

2024-02-23 Thread Jaegeuk Kim
On 02/22, Matias Bjørling wrote: > On 21-02-2024 18:27, Jaegeuk Kim wrote: > > > > Doesn't this break practically all ZNS NVMe devices? > > > > Yes, so here I'm in questioning who is really using w/ zone capacity. If > > there's > > no user complai

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: support file pinning for zoned devices

2024-02-23 Thread Jaegeuk Kim
conventional storage area for zoned devices > > > > Signed-off-by: Daeho Jeong > > Signed-off-by: Jaegeuk Kim > > --- > > v3: check the hole when migrating blocks for swap. > > do not use the remainder of cold pin section. > > v2: flush previous d

Re: [f2fs-dev] [PATCH 3/3 v2] f2fs: kill zone-capacity support

2024-02-21 Thread Jaegeuk Kim
On 02/21, Juhyung Park wrote: > On Wed, Feb 21, 2024 at 4:03 AM Jaegeuk Kim wrote: > > > > On 02/20, Chao Yu wrote: > > > Jaegeuk, Daeho, > > > > > > Do we need Cc WD guys? Not sure whether they need this feature... > > > > CC'ed WDC folks.

Re: [f2fs-dev] [PATCH] f2fs: support compress extension update via sysfs interface

2024-02-20 Thread Jaegeuk Kim
On 02/21, Chao Yu wrote: > On 2024/2/21 3:28, Jaegeuk Kim wrote: > > On 02/19, Chao Yu wrote: > > > On 2024/2/8 8:07, Jaegeuk Kim wrote: > > > > On 02/07, Chao Yu wrote: > > > > > Introduce /sys/fs/f2fs//compress_extension to support > > > >

Re: [f2fs-dev] [PATCH v2] f2fs: kill heap-based allocation

2024-02-20 Thread Jaegeuk Kim
On 02/21, Chao Yu wrote: > On 2024/2/21 4:51, Jaegeuk Kim wrote: > > No one uses this feature. Let's kill it. > > > > Reviewed-by: Daeho Jeong > > Signed-off-by: Jaegeuk Kim > > --- > > > > Change log from v1: > >- keep mount options

Re: [f2fs-dev] [PATCH 2/3 v3] f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and SEGS_PER_SEC

2024-02-20 Thread Jaegeuk Kim
On 02/21, Chao Yu wrote: > On 2024/2/21 4:39, Jaegeuk Kim wrote: > > No functional change. > > > > Reviewed-by: Daeho Jeong > > Signed-off-by: Jaegeuk Kim > > --- > >Change log from v2: > > - cover more cases > >Change log from v

[f2fs-dev] [PATCH 2/3] f2fs: prevent an f2fs_gc loop during disable_checkpoint

2024-02-20 Thread Jaegeuk Kim
Don't get stuck in the f2fs_gc loop while disabling checkpoint. Instead, we have a time-based management. Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ad80cd38f3a4..9de467a28fd3 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH 1/3] f2fs: check number of blocks in a current section

2024-02-20 Thread Jaegeuk Kim
In cfd66bb715fd ("f2fs: fix deadloop in foreground GC"), we needed to check the number of blocks in a section instead of the segment. Fixes: cfd66bb715fd ("f2fs: fix deadloop in foreground GC") Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.h | 8 1 file changed

[f2fs-dev] [PATCH 3/3] f2fs: allow to mount if cap is 100

2024-02-20 Thread Jaegeuk Kim
Don't block mounting the partition, if cap is 100%. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 160ee550cbfe..56927b097e30 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -894,6

Re: [f2fs-dev] [PATCH v2] f2fs: kill heap-based allocation

2024-02-20 Thread Jaegeuk Kim
No one uses this feature. Let's kill it. Reviewed-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- Change log from v1: - keep mount options but give warnings instead Documentation/filesystems/f2fs.rst | 4 +-- fs/f2fs/gc.c | 5 ++- fs/f2fs/segment.c

Re: [f2fs-dev] [PATCH 2/3 v3] f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and SEGS_PER_SEC

2024-02-20 Thread Jaegeuk Kim
No functional change. Reviewed-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- Change log from v2: - cover more cases Change log from v1: - use div_u64 fs/f2fs/checkpoint.c | 10 ++-- fs/f2fs/debug.c | 6 +-- fs/f2fs/f2fs.h | 21 + fs/f2fs/file.c | 16

  1   2   3   4   5   6   7   8   9   10   >