From: Bernd Schubert <bernd.schubert-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org> To: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, yong.fan-KloliPT79xf2eFz/2MeuCQ@public.gmane.org, adilger-KloliPT79xf2eFz/2MeuCQ@public.gmane.org, tytso-3s7WtUTddSA@public.gmane.org Subject: [PATCH 2/3] Remove check for a 32-bit cookie in nfsd4_readdir() Date: Wed, 27 Jul 2011 13:02:54 +0200 [thread overview] Message-ID: <20110727110254.204979.34074.stgit@localhost.localdomain> (raw) In-Reply-To: <20110727110148.204979.49551.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> Fan Yong <yong.fan-KloliPT79xf2eFz/2MeuCQ@public.gmane.org> noticed simply setting O_64BITHASH wouldn't work with nfsd v4, as nfsd4_readdir() checks for a 32 bit cookie. However, according to RFC 3530 cookies have a 64 bit type and it is also defined as u64 'struct nfsd4_readdir'. So remove the test for >32-bit values. Signed-off-by: Bernd Schubert <bernd.schubert-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org> --- fs/nfsd/nfs4proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 3a6dbd7..f7799d3 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -682,7 +682,7 @@ nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); - if ((cookie > ~(u32)0) || (cookie == 1) || (cookie == 2) || + if ((cookie == 1) || (cookie == 2) || (cookie == 0 && memcmp(readdir->rd_verf.data, zeroverf.data, NFS4_VERIFIER_SIZE))) return nfserr_bad_cookie; -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> To: linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, yong.fan@whamcloud.com, adilger@whamcloud.com, tytso@mit.edu Subject: [PATCH 2/3] Remove check for a 32-bit cookie in nfsd4_readdir() Date: Wed, 27 Jul 2011 13:02:54 +0200 [thread overview] Message-ID: <20110727110254.204979.34074.stgit@localhost.localdomain> (raw) In-Reply-To: <20110727110148.204979.49551.stgit@localhost.localdomain> Fan Yong <yong.fan@whamcloud.com> noticed simply setting O_64BITHASH wouldn't work with nfsd v4, as nfsd4_readdir() checks for a 32 bit cookie. However, according to RFC 3530 cookies have a 64 bit type and it is also defined as u64 'struct nfsd4_readdir'. So remove the test for >32-bit values. Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> --- fs/nfsd/nfs4proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 3a6dbd7..f7799d3 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -682,7 +682,7 @@ nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); - if ((cookie > ~(u32)0) || (cookie == 1) || (cookie == 2) || + if ((cookie == 1) || (cookie == 2) || (cookie == 0 && memcmp(readdir->rd_verf.data, zeroverf.data, NFS4_VERIFIER_SIZE))) return nfserr_bad_cookie;
next prev parent reply other threads:[~2011-07-27 11:02 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-07-27 11:02 [PATCH 0/3] 32/64 bit llseek hashes Bernd Schubert [not found] ` <20110727110148.204979.49551.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> 2011-07-27 11:02 ` [PATCH 1/3] Return 32/64-bit dir name hash according to usage type Bernd Schubert 2011-07-27 11:02 ` Bernd Schubert [not found] ` <20110727110249.204979.58769.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> 2011-07-27 21:02 ` Christoph Hellwig 2011-07-27 21:02 ` Christoph Hellwig 2011-07-28 20:04 ` Bernd Schubert 2011-07-27 11:02 ` Bernd Schubert [this message] 2011-07-27 11:02 ` [PATCH 2/3] Remove check for a 32-bit cookie in nfsd4_readdir() Bernd Schubert 2011-07-27 11:02 ` [PATCH 3/3] nfsd: vfs_llseek() with O_32BITHASH or O_64BITHASH Bernd Schubert [not found] ` <20110727110259.204979.56782.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> 2011-07-27 21:03 ` Christoph Hellwig 2011-07-27 21:03 ` Christoph Hellwig 2011-07-28 9:19 ` Bernd Schubert 2011-07-28 11:46 ` Christoph Hellwig
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=20110727110254.204979.34074.stgit@localhost.localdomain \ --to=bernd.schubert-mpn0npgs4xgatndf+kubs4quadtiucjx@public.gmane.org \ --cc=adilger-KloliPT79xf2eFz/2MeuCQ@public.gmane.org \ --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=tytso-3s7WtUTddSA@public.gmane.org \ --cc=yong.fan-KloliPT79xf2eFz/2MeuCQ@public.gmane.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: linkBe 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.