Received: by 10.223.176.5 with SMTP id f5csp987597wra; Fri, 2 Feb 2018 09:17:42 -0800 (PST) X-Google-Smtp-Source: AH8x224M5mmht+H0FoNnh6pZ1nRFuCncIJXi26Osc99oEIst3AizqoIuwRm9trigCQID74bfpnX7 X-Received: by 2002:a17:902:3383:: with SMTP id b3-v6mr36073061plc.240.1517591862438; Fri, 02 Feb 2018 09:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517591862; cv=none; d=google.com; s=arc-20160816; b=t1VJEK1W5L9ggW05ytVx1zRqlw+4Dy6J9aHBFz9nk8XNhIg4sEHhoo64uysnKt5Puj SSxy4Sg2SM4+WK+dd/ykmhPVUHfWJcqeVGoQc6kcPpEWfoHub5WlV8R1U/91mPAC8gGX Ub+SUSVYrBCdA7iZf6J5KGHLaKoaGXX1U53A8LOasnoKiPBTRRid1lynAEXkxfg2baIo bMNBcG78ngRVjVD+14SUFgs9VPdOKScMgRt/NyFufk8tnxDEqNeyQ3kUPVoDbiUMYgnd +x1z3pEZnm7nBHUwZ/JgpjPjAREcI5ZnWiTJCI0mK4Q0fdX2/QaSz3I5h+sFnCMSADDl vnxg== 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=BdRxI7Yw5luGOQLooGGJkUbVfXLAO2Lje+lDdl5kcB8=; b=V+a7Yw5Y+rnbdvehdyjVv1YL+2LyLNZZPT1yS9MDy4E9ZSikN3RUZ7U+mUp828UwdY Y/gGHmKeQr+m5kAEZkvlIc2wNCYR+wrVOXNm50flUb4mlfGctrcCNHKUiMLLFAq/t+go itjxuz0Rt0ewkHPVPI8ksi4G4HLnl6CqZ1gwn9xMoptDnyRFl+wFiRkE3tY2CjQMhyrK HibkU/wVgm0zCBioe3VF/AATDiOoYO0BBtGf6Au+NzBO8M9KstJSqSbmu8SIeEQJUnzI s/V4W86A6P/mKyTEWJmQhLzJ0kK9E4ijRoXugz+q9cjaXW0yQmhaJqpQk1h/ceEI2Y96 TF0g== 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 x185si52163pgx.159.2018.02.02.09.17.27; Fri, 02 Feb 2018 09:17:42 -0800 (PST) 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 S1753669AbeBBRQ6 (ORCPT + 99 others); Fri, 2 Feb 2018 12:16:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38458 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753347AbeBBRKu (ORCPT ); Fri, 2 Feb 2018 12:10:50 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 71069EB3; Fri, 2 Feb 2018 17:10:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , "J. Bruce Fields" , Sasha Levin Subject: [PATCH 4.14 085/156] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Date: Fri, 2 Feb 2018 17:57:46 +0100 Message-Id: <20180202140844.103622201@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust [ Upstream commit fb500a7cfee7f2f447d2bbf30cb59629feab6ac1 ] Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfs4state.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -63,6 +63,9 @@ static const stateid_t zero_stateid = { static const stateid_t currentstateid = { .si_generation = 1, }; +static const stateid_t close_stateid = { + .si_generation = 0xffffffffU, +}; static u64 current_sessionid = 1; @@ -5411,6 +5414,11 @@ nfsd4_close(struct svc_rqst *rqstp, stru nfsd4_close_open_stateid(stp); mutex_unlock(&stp->st_mutex); + /* See RFC5661 sectionm 18.2.4 */ + if (stp->st_stid.sc_client->cl_minorversion) + memcpy(&close->cl_stateid, &close_stateid, + sizeof(close->cl_stateid)); + /* put reference from nfs4_preprocess_seqid_op */ nfs4_put_stid(&stp->st_stid); out: