From owner-svn-src-all@FreeBSD.ORG Sat Jul 20 22:35:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 729DF9F7; Sat, 20 Jul 2013 22:35:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62C0B853; Sat, 20 Jul 2013 22:35:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KMZXRI060069; Sat, 20 Jul 2013 22:35:33 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KMZXqf060068; Sat, 20 Jul 2013 22:35:33 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307202235.r6KMZXqf060068@svn.freebsd.org> From: Rick Macklem Date: Sat, 20 Jul 2013 22:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253506 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 22:35:33 -0000 Author: rmacklem Date: Sat Jul 20 22:35:32 2013 New Revision: 253506 URL: http://svnweb.freebsd.org/changeset/base/253506 Log: 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: Andre Heider (a.heider@gmail.com) MFC after: 3 days Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sat Jul 20 16:58:17 2013 (r253505) +++ head/sys/fs/nfs/nfs_commonsubs.c Sat Jul 20 22:35:32 2013 (r253506) @@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript 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: