Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Eric W. Biederman
"Eric W. Biederman" writes: > I am confused what is going on with ext4 and f2fs. I think they > are calling d_invalidate when all they need to call is d_drop. ext4 and f2f2 are buggy in how they call d_invalidate, if I am reading the code correctly. d_invalidate calls detach_mounts. detach_mo

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Mon, Nov 27, 2023 at 09:47:47AM -0600, Eric W. Biederman wrote: > There is a lot going on there. I remember one of the relevant > restrictions was marking dentries dont_mount, and inodes S_DEAD > in unlink and rmdir. > > But even without out that marking if d_invalidate is called > from d_rev

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Eric W. Biederman
Al Viro writes: > On Sun, Nov 26, 2023 at 06:41:41PM +, Al Viro wrote: > >> d_invalidate() situation is more subtle - we need to sort out its interplay >> with d_splice_alias(). >> >> More concise variant of the scenario in question: >> * we have /mnt/foo/bar and a lot of its descendents in

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Mon, Nov 27, 2023 at 04:03:18PM +, Al Viro wrote: > On Mon, Nov 27, 2023 at 09:47:47AM -0600, Eric W. Biederman wrote: > > > There is a lot going on there. I remember one of the relevant > > restrictions was marking dentries dont_mount, and inodes S_DEAD > > in unlink and rmdir. > > > > B

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Christian Brauner
On Mon, Nov 27, 2023 at 06:38:42AM +, Al Viro wrote: > On Sun, Nov 26, 2023 at 06:41:41PM +, Al Viro wrote: > > > d_invalidate() situation is more subtle - we need to sort out its interplay > > with d_splice_alias(). > > > > More concise variant of the scenario in question: > > * we have

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Mon, Nov 27, 2023 at 10:01:34AM -0600, Eric W. Biederman wrote: > "Eric W. Biederman" writes: > > > I am confused what is going on with ext4 and f2fs. I think they > > are calling d_invalidate when all they need to call is d_drop. > > ext4 and f2f2 are buggy in how they call d_invalidate, if

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Eric W. Biederman
Al Viro writes: > On Mon, Nov 27, 2023 at 04:03:18PM +, Al Viro wrote: >> On Mon, Nov 27, 2023 at 09:47:47AM -0600, Eric W. Biederman wrote: >> >> > There is a lot going on there. I remember one of the relevant >> > restrictions was marking dentries dont_mount, and inodes S_DEAD >> > in unl

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Mon, Nov 27, 2023 at 05:25:44PM +, Al Viro wrote: > On Mon, Nov 27, 2023 at 10:01:34AM -0600, Eric W. Biederman wrote: > > "Eric W. Biederman" writes: > > > > > I am confused what is going on with ext4 and f2fs. I think they > > > are calling d_invalidate when all they need to call is d_d

Re: [f2fs-dev] fun with d_invalidate() vs. d_splice_alias() was Re: [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Mon, Nov 27, 2023 at 12:19:09PM -0600, Eric W. Biederman wrote: > Either we should decide it is useless and remove it and all of it's > children. > > Or we should decide it was renamed and just handle it that way. How? An extra roundtrip to server trying to do getattr on the fhandle we've go

Re: [f2fs-dev] [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs

2023-11-27 Thread Al Viro
On Fri, Nov 24, 2023 at 10:20:39AM -0500, Gabriel Krisman Bertazi wrote: > I'm not sure why it changed. I'm guessing that, since it doesn't make > sense to set fscrypt_d_revalidate for every dentry in the > !case-insensitive case, they just kept the same behavior for > case-insensitive+fscrypt.

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-27 Thread Daniel Rosenberg via Linux-f2fs-devel
On Sun, Nov 26, 2023 at 5:42 PM Chao Yu wrote: > > Hi Daniel, > > How about this? It be more explicit to indicate the logic? > > --- > fsck/mount.c | 2 ++ > include/f2fs_fs.h | 3 +++ > lib/libf2fs_io.c | 4 > 3 files changed, 9 insertions(+) > > diff --git a/fsck/mount.c b/fsck/m

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-27 Thread Chao Yu
On 2023/11/28 8:52, Daniel Rosenberg wrote: On Sun, Nov 26, 2023 at 5:42 PM Chao Yu wrote: Hi Daniel, How about this? It be more explicit to indicate the logic? --- fsck/mount.c | 2 ++ include/f2fs_fs.h | 3 +++ lib/libf2fs_io.c | 4 3 files changed, 9 insertions(+) dif

Re: [f2fs-dev] [PATCH] f2fs: show more discard stat by sysfs

2023-11-27 Thread Chao Yu
On 2023/11/24 9:08, Zhiguo Niu wrote: The current pending_discard attr just only shows the discard_cmd_cnt information, which is not very meaningful. More discard information can be shown so that we can check them through sysfs when needed. What about adding this entry to /sys/fs/f2fs//stat/?

Re: [f2fs-dev] [PATCH] f2fs: add support for an i_version counter

2023-11-27 Thread Chao Yu
On 2023/11/20 17:54, Yangtao Li wrote: NFSv4 mandates a change attribute to avoid problems with timestamp granularity, which Linux implements using the i_version counter. This is particularly important when the underlying filesystem is fast. Signed-off-by: Yangtao Li --- fs/f2fs/f2fs.h | 1 +

Re: [f2fs-dev] [PATCH] f2fs: show more discard stat by sysfs

2023-11-27 Thread Zhiguo Niu
Dear Chao, On Tue, Nov 28, 2023 at 10:13 AM Chao Yu wrote: > > On 2023/11/24 9:08, Zhiguo Niu wrote: > > The current pending_discard attr just only shows the discard_cmd_cnt > > information, which is not very meaningful. More discard information > > can be shown so that we can check them through

Re: [f2fs-dev] [PATCH 1/1] f2fs: fix fallocate failed under pinned block situation

2023-11-27 Thread Chao Yu
On 2023/11/17 7:34, Wu Bo wrote: On 2023/11/11 12:49, Chao Yu wrote: On 2023/11/8 21:48, Wu Bo wrote: On 2023/11/7 22:39, Chao Yu wrote: On 2023/10/30 17:40, Wu Bo wrote: If GC victim has pinned block, it can't be recycled. And if GC is foreground running, after many failure try, the pinned f

Re: [f2fs-dev] [PATCH v2] f2fs-tools: fixed incorrect error handling

2023-11-27 Thread Chao Yu
On 2023/11/20 15:55, Maxim Korotkov wrote: Case of failed memory allocation of dev->zone_cap_blocks doesn't release heap allocated rep Found by RASU JSC Fixes: f8410857b7a8(f2fs-tools: zns zone-capacity support) Signed-off-by: Maxim Korotkov Reviewed-by: Chao Yu Thanks, ___

[f2fs-dev] [PATCH V2] f2fs: show more discard status by sysfs

2023-11-27 Thread Zhiguo Niu
The current pending_discard attr just only shows the discard_cmd_cnt information. More discard status can be shown so that we can check them through sysfs when needed. Signed-off-by: Zhiguo Niu --- changes of v2: Improve the patch according to Chao's suggestions. --- --- Documentation/ABI/testin