Re: [PATCH v1 3/3] VFS/knfsd: Teach dentry_create() to use atomic_open()

From: Benjamin Coddington

Date: Tue Nov 18 2025 - 13:39:58 EST


On 18 Nov 2025, at 13:01, Mike Snitzer wrote:

> On Tue, Nov 18, 2025 at 11:33:59AM -0500, Benjamin Coddington wrote:
>
>> path.mnt = fhp->fh_export->ex_path.mnt;
>> - path.dentry = child;
>> + path.dentry = *child;
>> filp = dentry_create(&path, oflags, open->op_iattr.ia_mode,
>> current_cred());
>> + *child = path.dentry;
>> +
>> if (IS_ERR(filp))
>> return nfserrno(PTR_ERR(filp));
>>
>
> Given the potential for side-effect due to dentry_create() now using
> atomic_open() if available, I think you'd do well to update the
> comment block above dentry_create to make it clear that the caller
> really should pass along the dentry (regardless of whether
> dentry_create returns an ERR_PTR).

I will update the comment block to make it clear that the dentry you sent on
@path may be changed.

Ben