From: Bernd Schubert Subject: [PATCH 3/3] nfsd: vfs_llseek() with O_32BITHASH or O_64BITHASH Date: Wed, 27 Jul 2011 13:02:59 +0200 Message-ID: <20110727110259.204979.56782.stgit@localhost.localdomain> References: <20110727110148.204979.49551.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, yong.fan@whamcloud.com, adilger@whamcloud.com, tytso@mit.edu To: linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org Return-path: In-Reply-To: <20110727110148.204979.49551.stgit@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org Use 32-bit or 64-bit llseek() hashes for directory offsets depending on the NFS version. NFSv2 gets 32-bit hashes only. Signed-off-by: Bernd Schubert --- fs/nfsd/vfs.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index fd0acca..d79bbcd 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1994,6 +1994,12 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp, if (err) goto out; + /* NFSv2 only supports 32 bit cookies */ + if (rqstp->rq_vers > 2) + file->f_flags &= O_64BITHASH; + else + file->f_flags &= O_32BITHASH; + offset = vfs_llseek(file, offset, 0); if (offset < 0) { err = nfserrno((int)offset);