From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsv4.0/read: Test the behavior of reading near OFFSET_MAX
Date: Sat, 5 Feb 2022 15:06:59 -0500 [thread overview]
Message-ID: <20220205200659.GA13548@fieldses.org> (raw)
In-Reply-To: <164408072927.1028772.2263116854233914910.stgit@morisot.1015granger.net>
Applied, thanks!--b.
On Sat, Feb 05, 2022 at 12:05:29PM -0500, Chuck Lever wrote:
> On many systems, the internal representation of a file offset or
> file size is a signed 64-bit value. NFS, however, uses an unsigned
> value for these quantities. The server must convert incoming offsets
> and file sizes properly or risk an underflow.
>
> Add a test which exercises this corner case.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> nfs4.0/servertests/st_read.py | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/nfs4.0/servertests/st_read.py b/nfs4.0/servertests/st_read.py
> index 1b27f5d06f2f..f75b753d61c7 100644
> --- a/nfs4.0/servertests/st_read.py
> +++ b/nfs4.0/servertests/st_read.py
> @@ -91,6 +91,18 @@ def testLargeOffset(t, env):
> check(res, msg="Reading file /%s" % b'/'.join(env.opts.usefile))
> _compare(t, res, b'', True)
>
> +def testVeryLargeOffset(t, env):
> + """READ with offset far outside file
> +
> + FLAGS: read all
> + DEPEND: LOOKFILE
> + CODE: RD5a
> + """
> + c = env.c1
> + res = c.read_file(env.opts.usefile, 0x7ffffffffffffffc, 10)
> + check(res, msg="Reading file /%s" % b'/'.join(env.opts.usefile))
> + _compare(t, res, b'', True)
> +
> def testZeroCount(t, env):
> """READ with count=0
>
>
prev parent reply other threads:[~2022-02-05 20:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-05 17:05 [PATCH] nfsv4.0/read: Test the behavior of reading near OFFSET_MAX Chuck Lever
2022-02-05 20:06 ` J. Bruce Fields [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=20220205200659.GA13548@fieldses.org \
--to=bfields@fieldses.org \
--cc=chuck.lever@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.