Permalink
Browse files

MFC: r253506

The NFSv4 server incorrectly assumed that the high order words of
the attribute bitmap argument would be non-zero. This caused an
interoperability problem for a recent patch to the Linux NFSv4 client.
The Linux folks have changed their patch to avoid this, but this
patch fixes the problem on the server.

Reported and tested by:	a.heider@gmail.com (Andre Heider)
Approved by:	re (Xin Li)
  • Loading branch information...
rmacklem rmacklem
rmacklem authored and rmacklem committed Jul 24, 2013
1 parent f04b0e3 commit da6380681203770b3beefaa5438a7676e81d3dd8
Showing with 7 additions and 7 deletions.
  1. +7 −7 sys/fs/nfs/nfs_commonsubs.c
@@ -742,21 +742,21 @@ nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp,
error = NFSERR_BADXDR;
goto nfsmout;
}
- if (cnt > NFSATTRBIT_MAXWORDS) {
+ if (cnt > NFSATTRBIT_MAXWORDS)
outcnt = NFSATTRBIT_MAXWORDS;
- if (retnotsupp)
- *retnotsupp = NFSERR_ATTRNOTSUPP;
- } else {
+ else
outcnt = cnt;
- }
NFSZERO_ATTRBIT(attrbitp);
if (outcnt > 0) {
NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED);
for (i = 0; i < outcnt; i++)
attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++);
}
- if (cnt > outcnt)
- error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1);
+ for (i = 0; i < (cnt - outcnt); i++) {
+ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
+ if (retnotsupp != NULL && *tl != 0)
+ *retnotsupp = NFSERR_ATTRNOTSUPP;
+ }
if (cntp)
*cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED);
nfsmout:

0 comments on commit da63806

Please sign in to comment.