From patchwork Thu Jul 18 23:30:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Macklem X-Patchwork-Id: 2829981 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA2A89F4D4 for ; Thu, 18 Jul 2013 23:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CD71202F9 for ; Thu, 18 Jul 2013 23:31:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05971202EE for ; Thu, 18 Jul 2013 23:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934601Ab3GRXa6 (ORCPT ); Thu, 18 Jul 2013 19:30:58 -0400 Received: from esa-annu.mail.uoguelph.ca ([131.104.91.36]:2884 "EHLO esa-annu.net.uoguelph.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934571Ab3GRXa5 (ORCPT ); Thu, 18 Jul 2013 19:30:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAFB66FGDaFve/2dsb2JhbABahAuDBr1AgSh0giQBAQUjBFIbDgoRGQIEHzYGE4d+Aw+kdYhdDYhejSOCOBkbB4JbgSEDkBCDdoFujhCFJoMuIIFu X-IronPort-AV: E=Sophos;i="4.89,697,1367985600"; d="scan'208";a="40507298" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-annu.net.uoguelph.ca with ESMTP; 18 Jul 2013 19:30:56 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id CB5F6B3F12; Thu, 18 Jul 2013 19:30:55 -0400 (EDT) Date: Thu, 18 Jul 2013 19:30:55 -0400 (EDT) From: Rick Macklem To: Andre Heider Cc: Chuck Lever , linux-nfs@vger.kernel.org, Trond Myklebust Message-ID: <1774242197.1390191.1374190255822.JavaMail.root@uoguelph.ca> In-Reply-To: Subject: Re: [PATCH 1/2] NFSv4: Fix a regression against the FreeBSD server MIME-Version: 1.0 X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 7.2.1_GA_2790 (ZimbraWebClient - FF3.0 (Win)/7.2.1_GA_2790) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Andre Heider wrote: > On Wed, Jul 17, 2013 at 11:59 PM, Trond Myklebust > wrote: > > Technically, the Linux client is allowed by the NFSv4 spec to send > > 3 word bitmaps as part of an OPEN request. However, this causes the > > current FreeBSD server to return NFS4ERR_ATTRNOTSUPP errors. > > > > Fix the regression by making the Linux client use a 2 word bitmap > > unless > > doing NFSv4.2 with labeled NFS. > > > > Signed-off-by: Trond Myklebust > > Tested-by: Andre Heider > I've attached the patch I plan to commit to FreeBSD's head soon, which fixes the server so that it checks for the high order bitmaps words being non-zero before replying with NFS4_ERR_ATTRNOTSUPP. The patch is pretty straightforward, but if you can apply it to your server and test it against the unpatched Linux client, that would be appreciated. It will take a while for the patch to find its way to a FreeBSD release, so having the workaround in the Linux client will be very helpful. Thanks for reporting this, rick --- sys/fs/nfs/nfs_commonsubs.c.orig 2013-07-18 19:15:25.000000000 -0400 +++ sys/fs/nfs/nfs_commonsubs.c 2013-07-18 19:15:58.000000000 -0400 @@ -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: