Re: [PATCH v1 0/3] Allow knfsd to use atomic_open()

From: Benjamin Coddington

Date: Tue Nov 18 2025 - 12:17:30 EST


On 18 Nov 2025, at 11:58, Chuck Lever wrote:

> On 11/18/25 11:33 AM, Benjamin Coddington wrote:
>> We have workloads that will benefit from allowing knfsd to use atomic_open()
>> in the open/create path. There are two benefits; the first is the original
>> matter of correctness: when knfsd must perform both vfs_create() and
>> vfs_open() in series there can be races or error results that cause the
>> caller to receive unexpected results.
>
> Commit fb70bf124b05 ("NFSD: Instantiate a struct file when creating a
> regular NFSv4 file") was supposed to address this. If there are still
> issues, then a Fixes: tag and some explanation of where there are gaps
> would be welcome in the commit message or cover letter. We might need
> to identify LTS backport requirements, in that case.

The problem was noticed on a test that did open O_CREAT with mode 0 which
will succeed in creating the file but will return -EACCES from vfs_open() -
this specific test is mentioned in 3/3 description. Insane case, but I
suppose someone might want it to behave properly.

Thanks for the commit pointer, I will check out the BugLink on it. I will
add the Fixes tag in the next version if one emerges.

Ben