mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Doug Nazar <nazard@dragoninc.ca>,
	"'J. Bruce Fields'" <bfields@citi.umich.edu>,
	"'Al Viro'" <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.28-rc3 truncates nfsd results
Date: Tue, 04 Nov 2008 19:03:31 +0000	[thread overview]
Message-ID: <1225825411.11230.6.camel@macbook.infradead.org> (raw)
In-Reply-To: <491097DA.9040204@garzik.org>

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

On Tue, 2008-11-04 at 13:43 -0500, Jeff Garzik wrote:
> I'll try reverting this and see if the behavior improves, thanks for the 
> pointer...

See attached...

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

[-- Attachment #2: Attached message - [PATCH] nfsd: fix failure to set eof in readdir in some situations --]
[-- Type: message/rfc822, Size: 3187 bytes --]

From: "J. Bruce Fields" <bfields@fieldses.org>
To: linux-nfs@vger.kernel.org
Cc: David Woodhouse <David.Woodhouse@intel.com>, Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] nfsd: fix failure to set eof in readdir in some situations
Date: Thu, 30 Oct 2008 17:31:25 -0400
Message-ID: <20081030213125.GC24156@fieldses.org>

From: J. Bruce Fields <bfields@citi.umich.edu>

Before 14f7dd632011bb89c035722edd6ea0d90ca6b078 "[PATCH] Copy XFS
readdir hack into nfsd code", readdir_cd->err was reset to eof before
each call to vfs_readdir; afterwards, it is set only once.  Similarly,
c002a6c7977320f95b5edede5ce4e0eeecf291ff "[PATCH] Optimise NFS readdir
hack slightly", can cause us to exit without nfserr_eof set.  Fix this.

This ensures the "eof" bit is set when needed in readdir replies.  (The
particular case I saw was an nfsv4 readdir of an empty directory, which
returned with no entries (the protocol requires "." and ".." to be
filtered out), but with eof unset.)

Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 fs/nfsd/vfs.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

I'm queuing this up for 2.6.28.--b.

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0bc56f6..848a03e 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1912,6 +1912,7 @@ static int nfsd_buffered_readdir(struct file *file, filldir_t func,
 			de = (struct buffered_dirent *)((char *)de + reclen);
 		}
 		offset = vfs_llseek(file, 0, SEEK_CUR);
+		cdp->err = nfserr_eof;
 		if (!buf.full)
 			break;
 	}
-- 
1.5.5.rc1


  reply	other threads:[~2008-11-04 19:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 18:27 Doug Nazar
2008-11-04 18:43 ` Jeff Garzik
2008-11-04 19:03   ` David Woodhouse [this message]
2008-11-04 19:32     ` Doug Nazar
2008-11-04 20:08       ` David Woodhouse
2008-11-09 19:09   ` J. Bruce Fields
2008-11-04 19:36 ` J. Bruce Fields
2008-11-04 22:30 ` J. Bruce Fields
2008-11-05 11:16   ` Doug Nazar
2008-11-05 21:46     ` J. Bruce Fields
2008-11-05 23:07       ` J. Bruce Fields
2008-11-06  5:21       ` Doug Nazar

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=1225825411.11230.6.camel@macbook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=bfields@citi.umich.edu \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nazard@dragoninc.ca \
    --cc=viro@zeniv.linux.org.uk \
    /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®