Re: [PATCH v2] vfs: remove the excl argument from the ->create() inode_operation

NeilBrown
2025-11-07T22:30:18Z

On Sat, 08 Nov 2025, Jeff Layton wrote:
> With two exceptions, ->create() methods provided by filesystems ignore
> the "excl" flag. Those exception are NFS and GFS2 which both also
> provide ->atomic_open.
>
> Since ce8644fcadc5 ("lookup_open(): expand the call of vfs_create()"),
> the "excl" argument to the ->create() inode_operation is always set to
> true in vfs_create(). The ->create() call in lookup_open() sets it
> according to the O_EXCL open flag, but is never called if the filesystem
> provides ->atomic_open().
>
> The excl flag is therefore always either ignored or true. Remove it,
> and change NFS and GFS2 to act as if it were always true.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> Note that this is based on top of the dir delegation series [1]. LMK
> if the Documentation/ updates are too wordy.

Patch is very nice. I don't think the documentation is too wordy.
I think it is good that the two changes to the different files say
essentially the same thing but use different words. That helps.

Reviewed-by: NeilBrown <neil@brown.name>

>
> Full disclosure: I did use Claude code to generate the first
> approximation of this patch, but I had to fix a number of things that it
> missed. I probably could have given it better prompts. In any case, I'm
> not sure how to properly attribute this (or if I even need to).

My understanding is that if you fully understand (and can defend) the
code change with all its motivations and implications as well as if you
had written it yourself, then you don't need to attribute whatever fancy
text editor or IDE (e.g. Claude) that you used to help produce the
patch.

Thanks,
NeilBrown