linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@kernel.org>
To: Dai Ngo <dai.ngo@oracle.com>, Jorge.Mora@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] DIO: add NFSv4.2 READ_PLUS support for nfstest_dio
Date: Wed, 01 Oct 2025 19:53:49 -0400	[thread overview]
Message-ID: <80f31f25d97a2942f7b4e47729e8333af8913663.camel@kernel.org> (raw)
In-Reply-To: <1759357733-64526-1-git-send-email-dai.ngo@oracle.com>

On Wed, 2025-10-01 at 15:28 -0700, Dai Ngo wrote:
> From: Oracle Public Cloud User
> <opc@dngo-nfstest-client.allregionaliads.osdevelopmeniad.oraclevcn.co
> m>
> 
> Check for nfs_version >= 4.2 and use READ_PLUS instead of READ.

Hrmm... READ_PLUS is (like all NFSv4.2 features) optional to implement.
As such, you really should expect that a server implementation is
perfectly within its rights to return NFS4ERR_NOTSUPP, in which case
the client should fall back to using READ.

> 
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> ---
>  test/nfstest_dio | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/test/nfstest_dio b/test/nfstest_dio
> index 093e552..653a842 100755
> --- a/test/nfstest_dio
> +++ b/test/nfstest_dio
> @@ -617,6 +617,8 @@ class DioTest(TestUtil):
>  
>              if nfs_version < 4:
>                  match_str = "NFS.argop == %d and NFS.fh == b'%s'" %
> (NFSPROC3_READ, self.pktt.escape(filehandle))
> +            elif nfs_version >= 4.2:
> +                match_str = "NFS.argop == %d and NFS.stateid.other
> == b'%s'" % (OP_READ_PLUS, self.pktt.escape(stateid))
>              else:
>                  match_str = "NFS.argop == %d and NFS.stateid.other
> == b'%s'" % (OP_READ, self.pktt.escape(stateid))
>  
> @@ -744,9 +746,13 @@ class DioTest(TestUtil):
>              fd = None
>              bfd = None
>              ofd = None
> -            io_str  = "WRITE" if write else "READ"
> +            if self.nfs_version >= 4.2:
> +                io_str  = "WRITE" if write else "READ_PLUS"
> +                bio_str  = "WRITE" if buffered_write else
> "READ_PLUS"
> +            else:
> +                io_str  = "WRITE" if write else "READ"
> +                bio_str  = "WRITE" if buffered_write else "READ"
>              io_mode = posix.O_WRONLY|posix.O_CREAT if write else
> posix.O_RDONLY
> -            bio_str  = "WRITE" if buffered_write else "READ"
>              bio_mode = os.O_WRONLY|os.O_CREAT if buffered_write else
> os.O_RDONLY
>  
>              if not bsize:
> @@ -861,6 +867,8 @@ class DioTest(TestUtil):
>  
>              if nfs_version < 4:
>                  io_op  = NFSPROC3_WRITE if write else NFSPROC3_READ
> +            elif nfs_version >= 4.2:
> +                io_op  = OP_WRITE if write else OP_READ_PLUS
>              else:
>                  io_op  = OP_WRITE if write else OP_READ
>  
> @@ -985,6 +993,8 @@ class DioTest(TestUtil):
>  
>                  if nfs_version < 4:
>                      bio_op = NFSPROC3_WRITE if buffered_write else
> NFSPROC3_READ
> +                elif nfs_version >= 4.2:
> +                    bio_op = OP_WRITE if buffered_write else
> OP_READ_PLUS
>                  else:
>                      bio_op = OP_WRITE if buffered_write else OP_READ
>  
> @@ -1270,6 +1280,8 @@ class DioTest(TestUtil):
>  
>              if nfs_version < 4:
>                  io_op = NFSPROC3_WRITE if write else NFSPROC3_READ
> +            elif nfs_version >= 4.2:
> +                io_op  = OP_WRITE if write else OP_READ_PLUS
>              else:
>                  io_op = OP_WRITE if write else OP_READ
>  

  reply	other threads:[~2025-10-01 23:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 22:28 [PATCH 1/1] DIO: add NFSv4.2 READ_PLUS support for nfstest_dio Dai Ngo
2025-10-01 23:53 ` Trond Myklebust [this message]
2025-10-02  4:00   ` Dai Ngo
2025-10-02  8:25   ` pahtconf() api to test for sparse file support? " Aurélien Couderc
2025-10-02  8:22 ` READ_PLUS broken in Linux 6.12, worked in Linux 5.10! " Aurélien Couderc
2025-10-30 10:54   ` Aurélien Couderc
2025-10-30 13:10     ` Chuck Lever

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=80f31f25d97a2942f7b4e47729e8333af8913663.camel@kernel.org \
    --to=trondmy@kernel.org \
    --cc=Jorge.Mora@netapp.com \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).