No subject
Wed Sep 5 20:48:46 EDT 2007
bakeathon, the 4.1 server is supposed to treat the 32 bit stateid seqid
just like the 4.0 server, to provide the 4.1 client an ordering of
server execution when the client "sprays" OPENs (or LOCK) across
sessions on a single clientid.<br>
<br>
This patch allows 4.1 server to skip stateid seqid checks when the
stateid seqid is zero. Where does the draft say this? I can find a
discription of three other cases (other and seqid zero, other and
seqid all ones, other zero and seqid non-zero) but not a description of
other non-zero and seqid zero.<br>
<br>
I'm probably just not finding it.<br>
<br>
-->Andy<br>
<br>
draft 13 section 8.2.3. Special Stateids<br>
.......<br>
The following combinations of "other" and "seqid" are defined in<br>
NFSv4.1:<br>
<br>
o When "other" and "seqid" are both zero, the stateid is treated as<br>
a special anonymous stateid, which can be used in READ, WRITE, and<br>
SETATTR requests to indicate the absence of any open state<br>
associated with the request. When an anonymous stateid value is<br>
used, and an existing open denies the form of access requested,<br>
then access will be denied to the request. This stateid MUST NOT<br>
be used on operations to data servers (Section 14.7), nor may it<br>
be used as the argument to the WANT_DELEGATTION (Section 18.49)<br>
operation.<br>
<br>
o When "other" and "seqid" are both all ones, the stateid is a<br>
special read bypass stateid. When this value is used in WRITE or<br>
SETATTR, it is treated like the anonymous value. When used in<br>
READ, the server MAY grant access, even if access would normally<br>
be denied to READ requests. This stateid MUST NOT be used on<br>
operations to data servers, nor may it be used as the argument to<br>
<br>
<br>
<br>
Shepler, et al.
Expires January 2,
2008
[Page 145]<br>
^L<br>
Internet-Draft
NFSv4 Minor Version
1
July 2007<br>
<br>
<br>
the WANT_DELEGATION operation.<br>
<br>
o When "other" is zero and "seqid" is one, the stateid represents<br>
the current stateid, which is whatever value is the last stateid<br>
returned by an operation within the COMPOUND. In the case of an<br>
OPEN, the stateid returned for the open file, and not the<br>
delegation is used. The stateid passed to the operation in place<br>
of the special value has its "seqid" value set to zero, except<br>
when the current stateid is used by the operation CLOSE or<br>
OPEN_DOWNGRADE. If there is no operation in the COMPOUND which<br>
has returned a stateid value, the server MUST return the error<br>
NFS4ERR_BAD_STATEID.<br>
<br>
<br>
<br>
<br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Sager, Mike</b> <<a href="mailto:Mike.Sager at netapp.com">Mike.Sager at netapp.com</a>><br>Date: Sep 12, 2007 3:33 PM
<br>Subject: [pnfs] [PATCH 2/2] Update stateid generation number handling per latest draft<br>To: <a href="mailto:pnfs at linux-nfs.org">pnfs at linux-nfs.org</a><br><br></span>
<div>
<div><font face="Arial" size="2">If the generation number is 0, use the current
generation number. Also,<br>reinstate generation number checking for bad
or old stateids.</font></div>
<div> </div>
<div><font face="Arial" size="2">Signed-off-by: Mike <span id="st" name="st" class="st">Sager</span> <<a href="mailto:sager at netapp.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><span id="st" name="st" class="st">
sager</span>@netapp.com</a>><br>---<br> fs/nfsd/nfs4state.c
| 27 +++++++++++++++++----------<br> 1 files changed, 17
insertions(+), 10 deletions(-)</font></div>
<div> </div>
<div><font face="Arial" size="2">diff --git a/fs/nfsd/nfs4state.c
b/fs/nfsd/nfs4state.c<br>index b364707..be3600b 100644<br>---
a/fs/nfsd/nfs4state.c<br>+++ b/fs/nfsd/nfs4state.c<br>@@ -2762,15 +2762,22 @@
nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int
fl<br>
goto out;<br>
stidp = &stp->st_stateid;<br>
}<br>- if (flags & NFS_4_1 &&
stateid->si_generation !=0
)<br>-
goto out;<br>- if (!(flags & NFS_4_1)
&& stateid->si_generation >
stidp->si_generation)<br>+
/*<br>+ * In 4.1, if the stateid's
generation number is 0, use the<br>+ *
current generation<br>+
*/<br>+ if ((flags & NFS_4_1) &&
stateid->si_generation ==
0)<br>+
goto checkmode;<br>+<br>+ if
(stateid->si_generation >
stidp->si_generation)<br>
goto out;</font></div>
<div> </div>
<div><font face="Arial" size="2"> /* OLD
STATEID */<br> status =
nfserr_old_stateid;<br>- if (!(flags &
NFS_4_1) && stateid->si_generation <
stidp->si_generation)<br>+ if
(stateid->si_generation <
stidp->si_generation)<br>
goto out;<br>+<br>+checkmode:<br> if
(stp)
{<br>
if ((status =
nfs4_check_openmode(stp->st_access_bmap,flags)))<br>
goto out;<br>@@ -2894,12 +2901,12 @@ nfs4_preprocess_seqid_op(struct svc_fh
*current_fh, u32 seqid, stateid_t
*statei<br>
return nfserr_bad_stateid;<br>
}</font></div>
<div> </div>
<div><font face="Arial" size="2">- if
(sop->so_minorversion == 1)
{<br>-
if (stateid->si_generation !=
0)<br>-
return nfserr_bad_stateid;<br>-
else<br>-
goto renew; /* skip v4.0 generation number checks */<br>-
}<br>+
/*<br>+ * In 4.1, if the stateid's
generation number is 0, use the<br>+ *
current generation<br>+
*/<br>+ if (sop->so_minorversion == 1
&& stateid->si_generation ==
0)<br>+
goto renew;</font></div>
<div> </div>
<div><font face="Arial" size="2"> if
(stateid->si_generation > stp->st_stateid.si_generation)
{<br>
printk("NFSD: preprocess_seqid_op: future
stateid?!\n");<br>--<br><a href="http://1.5.2.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">1.5.2.1</a></font></div>
<div> </div>
<div><font face="Arial" size="2"></font> </div></div>
<br>_______________________________________________<br>pNFS mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:pNFS at linux-nfs.org">pNFS at linux-nfs.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs" target="_blank">
http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs</a><br>
------=_Part_16701_32751871.1190124086635--
More information about the pNFS
mailing list