From patchwork Wed Jul 27 11:02:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 1011402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6RB356L028240 for ; Wed, 27 Jul 2011 11:03:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646Ab1G0LDD (ORCPT ); Wed, 27 Jul 2011 07:03:03 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:42062 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754541Ab1G0LDB (ORCPT ); Wed, 27 Jul 2011 07:03:01 -0400 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6RB30Z8032457 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Wed, 27 Jul 2011 13:03:00 +0200 Received: from mail1.itwm.fhg.de ([131.246.191.78]:51715) by itwm2.itwm.fhg.de with esmtps (TLSv1:DES-CBC3-SHA:168) (/C=DE/ST=Rheinland-Pfalz/L=Kaiserslautern/O=Fraunhofer ITWM/OU=SLG/CN=mail1.itwm.fhg.de)(verified=1) (Exim 4.74 #1) id 1Qm1tD-0007Ed-T8; Wed, 27 Jul 2011 13:02:59 +0200 Subject: [PATCH 3/3] nfsd: vfs_llseek() with O_32BITHASH or O_64BITHASH To: linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org From: Bernd Schubert Cc: linux-fsdevel@vger.kernel.org, yong.fan@whamcloud.com, adilger@whamcloud.com, tytso@mit.edu Date: Wed, 27 Jul 2011 13:02:59 +0200 Message-ID: <20110727110259.204979.56782.stgit@localhost.localdomain> In-Reply-To: <20110727110148.204979.49551.stgit@localhost.localdomain> References: <20110727110148.204979.49551.stgit@localhost.localdomain> User-Agent: StGit/0.15 MIME-Version: 1.0 X-ITWM-CharSet: utf-8 X-ITWM-Scanned-By: mail1.itwm.fhg.de Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Jul 2011 11:03:05 +0000 (UTC) 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);