svn commit: r333788 - projects/pnfs-planb-server/sys/fs/nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Fri May 18 12:13:45 UTC 2018
Author: rmacklem
Date: Fri May 18 12:13:44 2018
New Revision: 333788
URL: https://svnweb.freebsd.org/changeset/base/333788
Log:
Fix LayoutReturn so that it only returns a stateid when the layout
will still exist after the LayoutReturn. I just found out about this
case when reading the correct section of RFC5661 again.
The handling of the FSID and ALL cases must still be fixed.
Modified:
projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c
Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 18 12:12:24 2018 (r333787)
+++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 18 12:13:44 2018 (r333788)
@@ -6650,8 +6650,8 @@ nfsrv_layoutreturn(struct nfsrv_descript *nd, vnode_t
fhandle_t fh;
int error = 0;
+ *fndp = 0;
if (kind == NFSV4LAYOUTRET_FILE) {
- *fndp = 0;
error = nfsvno_getfh(vp, &fh, p);
if (error == 0) {
error = nfsrv_updatemdsattr(vp, &na, p);
@@ -6683,7 +6683,6 @@ nfsrv_layoutreturn(struct nfsrv_descript *nd, vnode_t
if (++lyp->lay_stateid.seqid == 0)
lyp->lay_stateid.seqid = 1;
stateidp->seqid = lyp->lay_stateid.seqid;
- *fndp = 1;
if (offset == 0 && len == UINT64_MAX) {
if ((iomode & NFSLAYOUTIOMODE_READ) !=
0)
@@ -6693,7 +6692,10 @@ nfsrv_layoutreturn(struct nfsrv_descript *nd, vnode_t
if ((lyp->lay_flags & (NFSLAY_READ |
NFSLAY_RW)) == 0)
nfsrv_freelayout(lyp);
- }
+ else
+ *fndp = 1;
+ } else
+ *fndp = 1;
}
NFSUNLOCKLAYOUT(lhyp);
/* Search the nfsrv_recalllist for a match. */
More information about the svn-src-projects
mailing list