Received: by 10.192.165.156 with SMTP id m28csp1147290imm; Wed, 11 Apr 2018 13:19:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++oUX1hjxT7/Hh7E8zeyP709KbpFQ3nYX4he4e02QrIPG/mwXYlNRrQOtq3Pv8EZE50e5a X-Received: by 2002:a17:902:525:: with SMTP id 34-v6mr6473905plf.267.1523477964921; Wed, 11 Apr 2018 13:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477964; cv=none; d=google.com; s=arc-20160816; b=a0YJ63UlLF1YRwWck4vTItesfY0fuSSVhgIKNUkAUm96XVdTE3Dy9oOLTGfCNR3H8+ +QGG7WY94lkTmjt3JS2qgM/LO1eFUFea5A/JHXN/mgpfd3aH0pQU8YUlUQFWZy1o0a9I CZX0WcYnVnX1D20bFt+pYZXNMeICxI8UWZJs4xj2a00RtBUKZLe/G6hMczZax5N4lJSS M09Lo/4klvE8gMkESal4RZHJUWLVvc3rO1XMwXK0ngFSD+xrgENEaYNOuhrvUTPb4AMu NJk81y8n4m8q12RsB/+9vzdmpbexUJuvHOSysMLodYwB9aglXbC3TJn6gXrEjpNSeGse mj9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pY6guMryDh+RSCv+ur6/j9+98YcRuNxdSJyLLWNR0Q8=; b=LqMKk3LyALnlr7hgMz07f+0Y5UE6CzVaajA84nl87DIzOL/l6L8V/gf49JqZq2/Cgf pKjslADGaYYLnfIHpYZOeQ3lBx5NvQ2ZfIh3SAd6PA8TYMPGU6lfMWrIJmc0F/FfeNAN 2SHK/MQT49zG4AFxsUlodP785P7zP/ReGVgI0NBZf1JUM9C+7+ejiEjiR+ne5Bcoyl/2 HAJEPct3Uj2kb+3swke4IJxYYn0MxeMZnsdDsaeum4ewezwZhHBpqVi4l/4PxR2e9K1o afcGw+QuB3H5DxXVpAJ/IVS5VcUf18KcpaTxklRxw7Z1F+jvoxjlWeueyfLHACgybwaE cWsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si1697531plb.613.2018.04.11.13.18.47; Wed, 11 Apr 2018 13:19:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933313AbeDKSxh (ORCPT + 99 others); Wed, 11 Apr 2018 14:53:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933299AbeDKSxf (ORCPT ); Wed, 11 Apr 2018 14:53:35 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1D0B3EBA; Wed, 11 Apr 2018 18:53:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anna Schumaker , Trond Myklebust , Sasha Levin Subject: [PATCH 4.9 026/310] NFSv4.1: Work around a Linux server bug... Date: Wed, 11 Apr 2018 20:32:45 +0200 Message-Id: <20180411183623.421918196@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust [ Upstream commit f4b23de3dda1536590787c9e5c3d16b8738ab108 ] It turns out the Linux server has a bug in its implementation of supattr_exclcreat; it returns the set of all attributes, whether or not they are supported by minor version 1. In order to avoid a regression, we therefore apply the supported_attrs as a mask on top of whatever the server sent us. Reported-by: Anna Schumaker Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3300,6 +3300,7 @@ static int _nfs4_server_capabilities(str .rpc_resp = &res, }; int status; + int i; bitmask[0] = FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_FH_EXPIRE_TYPE | @@ -3365,8 +3366,13 @@ static int _nfs4_server_capabilities(str server->cache_consistency_bitmask[0] &= FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE; server->cache_consistency_bitmask[1] &= FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY; server->cache_consistency_bitmask[2] = 0; + + /* Avoid a regression due to buggy server */ + for (i = 0; i < ARRAY_SIZE(res.exclcreat_bitmask); i++) + res.exclcreat_bitmask[i] &= res.attr_bitmask[i]; memcpy(server->exclcreat_bitmask, res.exclcreat_bitmask, sizeof(server->exclcreat_bitmask)); + server->acl_bitmask = res.acl_bitmask; server->fh_expire_type = res.fh_expire_type; }