mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "Aurélien Couderc" <aurelien.couderc2002@gmail.com>, nfsv4@ietf.org
Cc: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	Anna Schumaker	 <Anna.Schumaker@netapp.com>,
	linux-nfs@vger.kernel.org, 	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NFSD: Reject a COPY whose source and destination are the same file
Date: Fri, 20 Nov 2026 13:16:11 -0800	[thread overview]
Message-ID: <03349d0b6b8b3cd2069f216871046093d75b17be.camel@kernel.org> (raw)
In-Reply-To: <CA+1jF5rurDObkiP0pg3Kp1vgB+sdxU6FYBaUUPWLJoHsoJ_6oQ@mail.gmail.com>

On Fri, 2026-11-20 at 08:55 +0100, Aurélien Couderc wrote:
> On Thu, Nov 19, 2026 at 6:44 PM Jeff Layton <jlayton@kernel.org> wrote:
> > 
> > RFC 7862 Section 15.2.3 says that COPY MUST fail with NFS4ERR_INVAL
> > when SAVED_FH and CURRENT_FH refer to the same file, whatever the
> > ranges. NFSD never checks for this. A same-file COPY with
> > non-overlapping ranges succeeds, and one with overlapping ranges fails
> > only because the VFS rejects it.
> > 
> > The overlap-only rule applies to CLONE (Section 15.13.3), so leave
> > nfsd4_verify_copy() alone. Instead, check in nfsd4_setup_intra_ssc(),
> > after both stateids are verified. For an inter-server copy, SAVED_FH
> > names a file on another server, so that path is not affected.
> > 
> > The Linux client never sends a same-file COPY, so this does not change
> > its behaviour. Found by pynfs COPY11.
> 
> Why should COPY within the same file be blocked?
>
> For example: Windows FSCTL_OFFLOAD_READ+FSCTL_OFFLOAD_WRITE is used
> exactly like that by databases like Oracle. Even advertised as a
> "database accelerator" feature...
> 
> Better tix the NFSv4.2 COPY spec at RFC level then...
> 

It does seem a bit restrictive, but that's way the RFC is written
today. If you want to lead an effort to update the RFC, then be my
guest!
-- 
Jeff Layton <jlayton@kernel.org>

      reply	other threads:[~2026-11-20 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 17:42 Jeff Layton
2026-11-19 18:48 ` Chuck Lever
2026-11-20  7:55 ` Aurélien Couderc
2026-11-20 21:16   ` 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=03349d0b6b8b3cd2069f216871046093d75b17be.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Anna.Schumaker@netapp.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=aurelien.couderc2002@gmail.com \
    --cc=cel@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=nfsv4@ietf.org \
    --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

all inboxes | Powered by JetHome®