From patchwork Tue Nov 17 03:44:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 7632561 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 460B6BF90C for ; Tue, 17 Nov 2015 03:45:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73A4B20414 for ; Tue, 17 Nov 2015 03:45:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E257203A4 for ; Tue, 17 Nov 2015 03:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbbKQDph (ORCPT ); Mon, 16 Nov 2015 22:45:37 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36823 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbbKQDou (ORCPT ); Mon, 16 Nov 2015 22:44:50 -0500 Received: by pacdm15 with SMTP id dm15so196526859pac.3 for ; Mon, 16 Nov 2015 19:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=1A2zCDSEGQlypuJ3NkHmOYmnz+p/ePXGhi3WzAl31kw=; b=QqW25AgeqUcHOBLdzt2LcEW2cgGluLEOhJ8m2DlgsEmAZWYdy25y+AH3hF8d1eFnFi kaBfy3Ed7PjDNtk9v05EtZq3Yn690nUNS1fxcR+m3YHvaF8CpSjbQbX4J7xr0yl0iuI5 9dUrL9JfmN8jmj7VX1Jo0RbeoOCtNpVOeqBQncYiMLfZFcBfR1B4HHRJfwO0l/9xTuf3 LXRrFQFIGI96jTJiMJiYbb05+p/CO318+anJ7VdSm8whZZNO99KW5M1zADaj43fN8Ylf KaJjZQ4Pff2vblHh++/y0I6DJXetGv7NgXWJFXFu1sIa6vWnBW52/G7nYgPy6Sn5XLjJ 9Jbg== X-Received: by 10.66.234.133 with SMTP id ue5mr59631640pac.56.1447731890278; Mon, 16 Nov 2015 19:44:50 -0800 (PST) Received: from [192.168.99.8] (li1439-189.members.linode.com. [45.118.132.189]) by smtp.googlemail.com with ESMTPSA id tn2sm39319339pbc.9.2015.11.16.19.44.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Nov 2015 19:44:49 -0800 (PST) From: Kinglong Mee Subject: [PATCH] NFS4: Cleanup FATTR4_WORD0_FS_LOCATIONS after decoding success To: Trond Myklebust Cc: "linux-nfs@vger.kernel.org" , Andreas Gruenbacher , kinglongmee@gmail.com Message-ID: <564AA29F.7060404@gmail.com> Date: Tue, 17 Nov 2015 11:44:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 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.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 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. # ll /mnt/ 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 --- fs/nfs/nfs4xdr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index dfed4f5..f9f9d94 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -3671,8 +3671,10 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st if (unlikely(status != 0)) goto out_eio; } - if (res->nlocations != 0) + if (res->nlocations != 0) { + bitmap[0] &= ~FATTR4_WORD0_FS_LOCATIONS; status = NFS_ATTR_FATTR_V4_LOCATIONS; + } out: dprintk("%s: fs_locations done, error = %d\n", __func__, status); return status;