aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfsserver
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/nfsserver')
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c8
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c28
2 files changed, 22 insertions, 14 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index 6a478ea012de..75393d457bcd 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -3095,7 +3095,13 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
*tl = txdr_unsigned(NFSV4OPEN_DELEGATEWRITE);
else if (retext != 0) {
*tl = txdr_unsigned(NFSV4OPEN_DELEGATENONEEXT);
- if ((rflags & NFSV4OPEN_WDCONTENTION) != 0) {
+ if ((rflags & NFSV4OPEN_WDNOTWANTED) != 0) {
+ NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV4OPEN_NOTWANTED);
+ } else if ((rflags & NFSV4OPEN_WDSUPPFTYPE) != 0) {
+ NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV4OPEN_NOTSUPPFTYPE);
+ } else if ((rflags & NFSV4OPEN_WDCONTENTION) != 0) {
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV4OPEN_CONTENTION);
*tl = newnfs_false;
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index d009a38fcb87..2f66d99da3e4 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -3097,7 +3097,13 @@ tryagain:
/*
* This is where we can choose to issue a delegation.
*/
- if (delegate == 0 || writedeleg == 0 ||
+ if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0)
+ *rflagsp |= NFSV4OPEN_WDNOTWANTED;
+ else if (nfsrv_issuedelegs == 0)
+ *rflagsp |= NFSV4OPEN_WDSUPPFTYPE;
+ else if (NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt))
+ *rflagsp |= NFSV4OPEN_WDRESOURCE;
+ else if (delegate == 0 || writedeleg == 0 ||
NFSVNO_EXRDONLY(exp) || (readonly != 0 &&
nfsrv_writedelegifpos == 0) ||
!NFSVNO_DELEGOK(vp) ||
@@ -3105,11 +3111,6 @@ tryagain:
(clp->lc_flags & (LCL_CALLBACKSON | LCL_CBDOWN)) !=
LCL_CALLBACKSON)
*rflagsp |= NFSV4OPEN_WDCONTENTION;
- else if (nfsrv_issuedelegs == 0 ||
- NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt))
- *rflagsp |= NFSV4OPEN_WDRESOURCE;
- else if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0)
- *rflagsp |= NFSV4OPEN_WDNOTWANTED;
else {
new_deleg->ls_stateid.seqid = delegstateidp->seqid = 1;
new_deleg->ls_stateid.other[0] = delegstateidp->other[0]
@@ -3160,16 +3161,17 @@ tryagain:
/*
* This is where we can choose to issue a delegation.
*/
- if (delegate == 0 || (writedeleg == 0 && readonly == 0) ||
- !NFSVNO_DELEGOK(vp) ||
+ if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0)
+ *rflagsp |= NFSV4OPEN_WDNOTWANTED;
+ else if (nfsrv_issuedelegs == 0)
+ *rflagsp |= NFSV4OPEN_WDSUPPFTYPE;
+ else if (NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt))
+ *rflagsp |= NFSV4OPEN_WDRESOURCE;
+ else if (delegate == 0 || (writedeleg == 0 &&
+ readonly == 0) || !NFSVNO_DELEGOK(vp) ||
(clp->lc_flags & (LCL_CALLBACKSON | LCL_CBDOWN)) !=
LCL_CALLBACKSON)
*rflagsp |= NFSV4OPEN_WDCONTENTION;
- else if (nfsrv_issuedelegs == 0 ||
- NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt))
- *rflagsp |= NFSV4OPEN_WDRESOURCE;
- else if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0)
- *rflagsp |= NFSV4OPEN_WDNOTWANTED;
else {
new_deleg->ls_stateid.seqid = delegstateidp->seqid = 1;
new_deleg->ls_stateid.other[0] = delegstateidp->other[0]