Received: by 10.223.176.5 with SMTP id f5csp2839860wra; Mon, 5 Feb 2018 10:44:24 -0800 (PST) X-Google-Smtp-Source: AH8x226EZ6fiQOWVF1UXchCUtaoIunwQmBw+Igx1m53p/xbJ2uepFJkM0u57jp5nd/JEyCxmxwu/ X-Received: by 10.99.1.70 with SMTP id 67mr2768074pgb.23.1517856264569; Mon, 05 Feb 2018 10:44:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517856264; cv=none; d=google.com; s=arc-20160816; b=Umf+1DCXOFX8zaTyJD/7basx7O0t+9iPgu4aVHOhEu/jBlSS8PIU6uYfkSJJVf2P3S RTR/K7ZGfVZ8c8JL8vpPnwcQ7rURAKtWXZ1S3rI82KnMPBjR1imE+SgKR6jIKPVvX2B0 qXRTziV4DEeE3Ufim469pVu+bxJcE9q5ldCTDxIRBfeilwuQiIamD/uRqLIww9RM1tPx 4INsCUeBuN8BDMC3PApxmQTF6H6f4gg7ndzxns7WnyrOzmITETU5QG8Gor2/5gc2ikZ+ 9GFgilB5EMi6PFL74XZUCVzSUfocqBw7r8+fhzB4hEmq+jKHwzLJ/spUNz6yOLcVzyi7 cKMw== 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=sEwPz79Ghg6r59zw8dmqb9BZV1dJCUsMvWIohBqzzU8=; b=WyFZCE1YNJETAQI2K/7J5wzOUJ5C02Q9nFQShUpfZ3gIuP+jcEne55yWfVfVtmRQQk f+N3CXFNyz7QDaYpOqSoi/E2aENnBeAJYFx/wPfy3ZvzDFgbM/EciVz3OlWWaXDhsp16 sWBc6/329sDMUJyidD+EX+hvSUa2QF5v/78wA9aPe9k4RfbbaY1Szyz2R3oJVmFj5ZtJ AjL9GFUcRarNyysougoIRJ2oPEc05vdQ4zrcrmF+zQJGKafNdG9f19HoLuyEnIN7CZxr 3/GtQu1dJQxC2hlwsvGI+cMFuV7i4tWDQSw8WmNBoQTH86+6kXadsr8nK98e3wLrGk2J QsLQ== 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 n10-v6si3668529plk.255.2018.02.05.10.44.09; Mon, 05 Feb 2018 10:44:24 -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 S1753964AbeBESnr (ORCPT + 99 others); Mon, 5 Feb 2018 13:43:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:53470 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753892AbeBES0Q (ORCPT ); Mon, 5 Feb 2018 13:26:16 -0500 Received: from localhost (unknown [104.132.1.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 593C61163; Mon, 5 Feb 2018 18:26:09 +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 3.18 16/36] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Date: Mon, 5 Feb 2018 10:23:44 -0800 Message-Id: <20180205182352.444636113@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180205182351.774761393@linuxfoundation.org> References: <20180205182351.774761393@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 3.18-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 @@ -62,6 +62,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; @@ -4901,6 +4904,11 @@ nfsd4_close(struct svc_rqst *rqstp, stru nfsd4_close_open_stateid(stp); + /* 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: