public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: cel@kernel.org, Amir Goldstein <amir73il@gmail.com>,
	Neil Brown <neilb@suse.de>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v3 0/4] Avoid returning NFS4ERR_FILE_OPEN when not appropriate
Date: Mon, 27 Jan 2025 09:50:19 -0500	[thread overview]
Message-ID: <b6badc6c55d60a1be4046ae0af53628c0a7f2020.camel@kernel.org> (raw)
In-Reply-To: <20250126215020.2466-1-cel@kernel.org>

On Sun, 2025-01-26 at 16:50 -0500, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> This short series aims to prevent NFSD from returning
> NFS4ERR_FILE_OPEN when an NFSv4 LINK, RENAME, or REMOVE operation
> targets a directory.  The only time the protocol spec permits a
> server to return FILE_OPEN is when the target of the operation is an
> object that is open and cannot be closed immediately to satisfy the
> request.
> 
> I would have preferred these fixes go into NFSv4-specific sections
> of NFSD, but the current structure of the code prevents doing that
> while maintaining operational efficiency. Plus, these small patches
> should be able to apply cleanly to LTS kernels.
> 
> We can defer deeper restructuring for later. For example,
> fh_verify() could be made to return an errno instead of a generic
> NFS status code; then the VFS utility functions in fs/nfsd/vfs.c
> could be made to do the same, making their callers responsible for
> the proper NFS version-specific translation of the errno into a
> status code.
>
> This series has passed git regression and xfstests. I'm interested
> in review and comment about this approach, but please do test these
> if you have the ability to trigger -EBUSY easily.
> 
> NFSv4 OPEN is also affected, but because of its complexity will
> require careful audit (ie, a separate patch set). Please send a copy
> of the output of WARN_ONCE so we can see where to start digging in
> that area.
> 
> Changes since v2:
> - Fix crash when renaming to a non-existent object
> 
> Changes since RFC:
> - Address a minor code odor
> - Clarify some code comments
> 
> Chuck Lever (4):
>   NFSD: nfsd_unlink() clobbers non-zero status returned from
>     fh_fill_pre_attrs()
>   NFSD: Never return NFS4ERR_FILE_OPEN when removing a directory
>   NFSD: Return NFS4ERR_FILE_OPEN only when renaming over an open file
>   NFSD: Return NFS4ERR_FILE_OPEN only when linking an open file
> 
>  fs/nfsd/vfs.c | 105 +++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 79 insertions(+), 26 deletions(-)
> 

This all looks pretty reasonable to me.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2025-01-27 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26 21:50 [PATCH v3 0/4] Avoid returning NFS4ERR_FILE_OPEN when not appropriate cel
2025-01-26 21:50 ` [PATCH v3 1/4] NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs() cel
2025-01-26 21:50 ` [PATCH v3 2/4] NFSD: Never return NFS4ERR_FILE_OPEN when removing a directory cel
2025-01-26 21:50 ` [PATCH v3 3/4] NFSD: Return NFS4ERR_FILE_OPEN only when renaming over an open file cel
2025-01-26 21:50 ` [PATCH v3 4/4] NFSD: Return NFS4ERR_FILE_OPEN only when linking " cel
2025-01-27 14:50 ` Jeff Layton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6badc6c55d60a1be4046ae0af53628c0a7f2020.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox