From: "J. Bruce Fields" <bfields@fieldses.org>
To: linux-nfs@vger.kernel.org
Cc: Casey Bodley <cbodley@citi.umich.edu>
Subject: [PATCH] nfsd4: in-stateid seqid should start with 1
Date: Wed, 31 Aug 2011 15:53:29 -0400 [thread overview]
Message-ID: <20110831195329.GD19223@fieldses.org> (raw)
From: J. Bruce Fields <bfields@redhat.com>
Thanks to Casey for reminding me that 5661 gives a special meaning to a
value of 0 in the stateid's seqid field, so we should instead be
starting out stateid's with si_generation 1.
Reported-by: Casey Bodley <cbodley@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
fs/nfsd/nfs4state.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 49c3dd1..7caa812 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -251,7 +251,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
dp->dl_stateid.si_boot = boot_time;
dp->dl_stateid.si_stateownerid = current_delegid++;
dp->dl_stateid.si_fileid = 0;
- dp->dl_stateid.si_generation = 0;
+ dp->dl_stateid.si_generation = 1;
fh_copy_shallow(&dp->dl_fh, ¤t_fh->fh_handle);
dp->dl_time = 0;
atomic_set(&dp->dl_count, 1);
@@ -2303,7 +2303,7 @@ init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *
stp->st_stateid.si_boot = boot_time;
stp->st_stateid.si_stateownerid = oo->oo_owner.so_id;
stp->st_stateid.si_fileid = fp->fi_id;
- stp->st_stateid.si_generation = 0;
+ stp->st_stateid.si_generation = 1;
stp->st_access_bmap = 0;
stp->st_deny_bmap = 0;
__set_bit(open->op_share_access & ~NFS4_SHARE_WANT_MASK,
@@ -3898,7 +3898,7 @@ alloc_init_lock_stateid(struct nfs4_lockowner *lo, struct nfs4_file *fp, struct
stp->st_stateid.si_boot = boot_time;
stp->st_stateid.si_stateownerid = lo->lo_owner.so_id;
stp->st_stateid.si_fileid = fp->fi_id;
- stp->st_stateid.si_generation = 0;
+ stp->st_stateid.si_generation = 1;
stp->st_access_bmap = 0;
stp->st_deny_bmap = open_stp->st_deny_bmap;
stp->st_openstp = open_stp;
--
1.7.4.1
next reply other threads:[~2011-08-31 19:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 19:53 J. Bruce Fields [this message]
2011-08-31 20:27 ` [PATCH] nfsd4: in-stateid seqid should start with 1 Benny Halevy
2011-08-31 21:19 ` J. Bruce Fields
2011-08-31 21:29 ` Benny Halevy
2011-08-31 21:33 ` J. Bruce Fields
2011-09-08 12:32 ` Benny Halevy
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=20110831195329.GD19223@fieldses.org \
--to=bfields@fieldses.org \
--cc=cbodley@citi.umich.edu \
--cc=linux-nfs@vger.kernel.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: 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;
as well as URLs for NNTP newsgroup(s).