Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Anna Schumaker <Anna.Schumaker@netapp.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
	Anna Schumaker <schumakeranna@gmail.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs: fix v4.2 SEEK on files over 2 gigs
Date: Thu, 17 Sep 2015 09:25:52 -0400	[thread overview]
Message-ID: <20150917132552.GD9870@fieldses.org> (raw)
In-Reply-To: <55FABA40.6010406@Netapp.com>

On Thu, Sep 17, 2015 at 09:04:00AM -0400, Anna Schumaker wrote:
> Hey Bruce,
> 
> I actually worked on a version of this patch on my own yesterday, too.  Looks like you beat me to submitting it!  :)

Oh, OK, well feel free to credit it however you'd like.

> On 09/16/2015 05:21 PM, J. Bruce Fields wrote:
> > From: "J. Bruce Fields" <bfields@redhat.com>
> > 
> > We're incorrectly assigning a loff_t return to an int.  If SEEK_HOLE or
> > SEEK_DATA returns an offset over 2^31 then the application will see a
> > weird lseek() result (usually -EIO).
> 
> I saw roughly the same thing with xfstests generic/285.

I maybe should have included my reproducer in the changelog, which was:

	git clone git://git.infradead.org/users/dedekind/bmap-tools.git
	cd bmap-tools

	mount overs=4.2 localhost:/exports /mnt/
	dd if=/dev/zero of=/mnt/test1.image seek=2097152 bs=1K count=1

	./bmaptool  create  /mnt/test1.image

In the good case it outputs some xml, in the bad case it aborts with an
IO error.

--b.

> > Cc: stable@vger.kernel.org
> > Fixes: bdcc2cd14e4e "NFSv4.2: handle NFS-specific llseek errors"
> > Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> 
> Reviewed-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> > ---
> >  fs/nfs/nfs42proc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> > index d731bbf974aa..0f020e4d8421 100644
> > --- a/fs/nfs/nfs42proc.c
> > +++ b/fs/nfs/nfs42proc.c
> > @@ -175,10 +175,12 @@ loff_t nfs42_proc_llseek(struct file *filep, loff_t offset, int whence)
> >  {
> >  	struct nfs_server *server = NFS_SERVER(file_inode(filep));
> >  	struct nfs4_exception exception = { };
> > -	int err;
> > +	loff_t err;
> >  
> >  	do {
> >  		err = _nfs42_proc_llseek(filep, offset, whence);
> > +		if (err >= 0)
> > +			break;
> >  		if (err == -ENOTSUPP)
> >  			return -EOPNOTSUPP;
> >  		err = nfs4_handle_exception(server, err, &exception);
> > 

  reply	other threads:[~2015-09-17 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 21:21 [PATCH] nfs: fix v4.2 SEEK on files over 2 gigs J. Bruce Fields
2015-09-17 13:04 ` Anna Schumaker
2015-09-17 13:25   ` J. Bruce Fields [this message]
2015-09-17 13:44     ` Anna Schumaker

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=20150917132552.GD9870@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Anna.Schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumakeranna@gmail.com \
    --cc=trond.myklebust@primarydata.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