Received: by 10.192.165.156 with SMTP id m28csp1179651imm; Wed, 11 Apr 2018 14:01:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/exVIphrQoWPZYYPiVz38i0w1iKdmPkCfCm+S88QgZTz77JyvLucancBisLbISCsI1pY+i X-Received: by 10.99.61.202 with SMTP id k193mr4509280pga.435.1523480481447; Wed, 11 Apr 2018 14:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523480481; cv=none; d=google.com; s=arc-20160816; b=U/mVwbQIdBPu3BaW68aEQvse+kqGG9uydu17zJv3tr07J19YCJl/+zVHBQvMTgRlQc Xgf0jTraCX9PnLm/+6p8yvLlVZzxEofMhdBiJs13ZYr+xe4r9ndHAx2+92spjUdhfxly mHSiS+SdKxiOxDNgCgKeMDjVtOSJuYtlEfXRRP3QxkoZFDnNs4j/6gJIVSUEZim3bpD2 P5XBQcWkPpsOdNqAfgHeppp+SexctdaPkzMmR8kBSAwLVMCEhxc1wCw60jHRPhyjAsDQ qUVqKItXYmk+5JC0Cv5cMBRnLG6I9Coj2ODrkK9ezQGQxM4ievEZgidoJmdcgUghj0yv 61lg== 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=br1mlNl9rn7MEDBYLxZgDGK+W8jDHgJ23iOyD85W8q4=; b=qlvEJ2FdjKCZpLgw+Ngg0PF7Kjt//o/ZCrYecmso/xiN+ki4/05NOChNYKrALVE3Jt atDqER+bw+NdVUJI9eACe4dqeq4Hvo//vxSLf6UVjHS6AISpH0+Z+O1oDWUotFjuRjim AvwlSE13PXFCJWZQLan5bWCqq9fYrX4PR+ClaNQtNsLLVHkWsORlnIi5oUFSVS9I986n +XAqcteYkEo9DIwVlAebN9ZCu8oALeqeFr2HZCbKIh/LGh6XEZJy9DkOI8W6r6/DBRL2 gmRYZFcmPHkRYVSXj8jbU5VOM4/uX8zB0pFu8TqwNlKExHbzFrVG+FVTEMFA1n0x7Nao DdMA== 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 u22-v6si1706150plk.608.2018.04.11.14.00.43; Wed, 11 Apr 2018 14:01:21 -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 S1755367AbeDKSoN (ORCPT + 99 others); Wed, 11 Apr 2018 14:44:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57840 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932171AbeDKSoJ (ORCPT ); Wed, 11 Apr 2018 14:44:09 -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 2CB48EBD; Wed, 11 Apr 2018 18:44:09 +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.4 019/190] NFSv4.1: Work around a Linux server bug... Date: Wed, 11 Apr 2018 20:34:25 +0200 Message-Id: <20180411183551.233575658@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@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.4-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 @@ -3025,6 +3025,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 | @@ -3090,8 +3091,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; }