From patchwork Tue Nov 17 09:12:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 7634131 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4DC3A9F1C2 for ; Tue, 17 Nov 2015 09:12:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 834E3203B5 for ; Tue, 17 Nov 2015 09:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8ED512035B for ; Tue, 17 Nov 2015 09:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbbKQJMh (ORCPT ); Tue, 17 Nov 2015 04:12:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57770 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752977AbbKQJMe (ORCPT ); Tue, 17 Nov 2015 04:12:34 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 0277F19F20F; Tue, 17 Nov 2015 09:12:33 +0000 (UTC) Received: from nux.redhat.com (vpn1-4-65.ams2.redhat.com [10.36.4.65]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAH9CUEa025217; Tue, 17 Nov 2015 04:12:31 -0500 From: Andreas Gruenbacher To: Kinglong Mee , Trond Myklebust Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH] NFS4: Cleanup FATTR4_WORD0_FS_LOCATIONS after decoding success Date: Tue, 17 Nov 2015 10:12:29 +0100 Message-Id: <1447751549-1946-1-git-send-email-agruenba@redhat.com> References: <564AA29F.7060404@gmail.com> In-Reply-To: <564AA29F.7060404@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Kinglong Mee Kinglong, On Tue, Nov 17, 2015 at 4:44 AM, Kinglong Mee wrote: > Commit 1ca843a2d2 "nfs: Fix GETATTR bitmap verification" has > check the bitmap after decoding success, but decode_attr_fs_locations > forgets cleanup the FATTR4_WORD0_FS_LOCATIONS bits. > > decode_getfattr_attrs always return -EIO when meeting FS_LOCATIONS now. > > ls: cannot access /mnt/referal: Input/output error > ls: cannot access /mnt/replicas: Input/output error > total 32 > drwxr-xr-x. 7 root root 8192 Nov 16 20:36 pnfs > ??????????? ? ? ? ? ? referal > ??????????? ? ? ? ? ? replicas > > Signed-off-by: Kinglong Mee this looks like the right kind of fix, I think we can clear the bit earlier in decode_attr_fs_locations though, as below. Thanks, Andreas --- fs/nfs/nfs4xdr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 6779feb..55b4493 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -3637,6 +3637,7 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st status = 0; if (unlikely(!(bitmap[0] & FATTR4_WORD0_FS_LOCATIONS))) goto out; + bitmap[0] &= ~FATTR4_WORD0_FS_LOCATIONS; status = -EIO; /* Ignore borken servers that return unrequested attrs */ if (unlikely(res == NULL))