Received: by 10.223.176.46 with SMTP id f43csp278883wra; Tue, 23 Jan 2018 20:56:01 -0800 (PST) X-Google-Smtp-Source: AH8x226rVzxT7rXIxN6wVeYxDzdlwej5THz2Y7rwq6DXeT2NH59JIr7A61juQ9B+GpsbWE9JVXsS X-Received: by 10.98.150.213 with SMTP id s82mr12010701pfk.10.1516769761435; Tue, 23 Jan 2018 20:56:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516769761; cv=none; d=google.com; s=arc-20160816; b=BZT6NI+zkfMLa9RP0uFb0sLOm96YwLNthyM0RrFSFnmhSaYiaYX7VluC/W4+CXBhvd pAmJgqI4ALgE81eyLZ4VBAo10kKs9GX8Wa6thfdfv0blNNmXFzHLiTeZCg+8i0ZmfO3W 1IUDIKRijgjNUVBTXPG8WL35VduB17yPFa6MjD1VTzL5u3N9DwU0FVdASTRZQ9zIxXEv qEEzhnDaRLAohdVgalhoxOzNk8oqpwSTsBqSvCRQ7HDcRs2B3CGQv1LJu/msFDrZF+M9 tXuieDk4UcIt3dPbdjG5OXtr2UNv8mz9erk1ngoYg7R5P7KW3+sjlaGjBMTHbOjEvyvP RNww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=kwrM+HG2cRi2H5Cb/6XUi9/87P7tCwrrTue2KR/UnlA=; b=FzP1IsENo3//0qOvkg6f8+RE1aukxI1bTpo67tYu/4VhToX2cFznhmvd21sJZtMi7Z /I3vLMUqOJ5pcsmL310fwX0AoK/4WsQjEghKxFBVgxKNjtXbXtaXYGFa6/Ts6Icby5zK 8y0p1iWihcNOe/60BFGJX76EuYl/K1Dzd+6J1xUpauuySJB2f9pXwtplamdHP/7DWGeW BXDiKPNsfLn6qIa77CuzqDQGlseajrZsS+tlUeRkXtYgekrO6wu3T5yjqfcozb18vh35 CgJ5Swj+AYHcN2WYNJAKButnJ94e49pBujGBIVJ3t+1EfzHQnSaymvLG6o37Bzc5KU+h 6f8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Ita4b36f; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi1-v6si4380692plb.45.2018.01.23.20.55.46; Tue, 23 Jan 2018 20:56:01 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Ita4b36f; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932543AbeAXEzU (ORCPT + 99 others); Tue, 23 Jan 2018 23:55:20 -0500 Received: from mail-dm3nam03on0107.outbound.protection.outlook.com ([104.47.41.107]:39081 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932218AbeAXEP0 (ORCPT ); Tue, 23 Jan 2018 23:15:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kwrM+HG2cRi2H5Cb/6XUi9/87P7tCwrrTue2KR/UnlA=; b=Ita4b36f5LHDVMdF4ykhGjGt+c4UE5+cPGJ0sFHhUxkepDl97jDdaJV7H5RCwQPuP8Wwc4I8xDSKmkOQUnfHJaQHh/0ztFtWHIAKkpBOxkeNLY77IBuFX52v2BF8PRglOMRy3SI7nE1xMEaLo23a/TFWBm370BpfFdM6bdm4uKg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1015.namprd21.prod.outlook.com (52.132.133.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.464.0; Wed, 24 Jan 2018 04:15:20 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7%2]) with mapi id 15.20.0464.000; Wed, 24 Jan 2018 04:15:20 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Trond Myklebust , "J . Bruce Fields" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 056/100] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Thread-Topic: [PATCH AUTOSEL for 4.14 056/100] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Thread-Index: AQHTlMni5GhZqnxJJkuCFP3LOY0PEw== Date: Wed, 24 Jan 2018 04:14:53 +0000 Message-ID: <20180124041414.32065-56-alexander.levin@microsoft.com> References: <20180124041414.32065-1-alexander.levin@microsoft.com> In-Reply-To: <20180124041414.32065-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1015;6:hty2TVV2DqvZf+IOu1z4Ts0WIn+5XL2NMxEB6FPZ04RJyuHzWSCcHO9TVk9Bwa/0JMU2Q+Mjrr+bOkQBrbZGdkjoesepQqNnq06KHkhCk3x++kQqTnNHjqJZ6K1lvpjIwvVXm3SnaglstqIhHAhWq2zlrh0yuqjXIrYztqzTOR+34T3uBXGMd2+a2r5fNN0Jp5HSLwgCMYMFue1UqNNK9H7NjT63t07oRz3YznQAe8R5iAoctMeYstBQksgPkzN0Xq7QHiCJOuO85rq9BI3DO3kWnM/FdcUHCE6Kcezdy9pCrVLEHy89vsxNhaG2G+cDDr3pQ3Z6N5HWdtp7hRdfdZ7PjE3O3Q5kfQpj8/cEX9IheQblOph/QjuFddnY59+7;5:Yx2mbTvuGwwIvvZTX6mf1JoZRvnEqibzUPrmt/Afk2jC3mbv4CscFVyOWH3JAcfYPJzSu400GSjkhhyHc8XeWLVHDg1TrbyG0MbGV4d69zMZNqnrjX0Gs4NOzR1SuWWrzsqKonaO3HRU+sWLICzUe8+RxLvI57rUf2nQHg2awQc=;24:+cT/deCM5j8vW3P4GTnjDiWjCdN0arGRCZwHBoe45PnFlxL/ngYAQUG8QUN7GBD6Tpk5FTnUn5yIHtrXmAy0O73dJweF0gbEGs2pHRwuM90=;7:aVApAtiJdb8tloTeAH7Cp6S8tUWUiLZcNBzGTCkS2Z170rntvd19pyAXd9zlf5hXauuzVDrNjigeJYhOp6YRekh+R0sSZk+xGDfIw38Q3XIJ9wCbUxz+hMvvczEOqpEXVrHBpjkhmehYJPgQJCG1o3TECPXKU5mEhsIyxl8gqCe/c1bN305ayRBrw9helFLUsHaw5ZMOarz5gU5CJG/UrUJi9cYPiZkU9rLSIo4f1DVfC+O0y+eGNG8EqsdZEf/R x-ms-office365-filtering-correlation-id: 9422ddba-65d2-4daf-76ac-08d562e11501 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020);SRVR:DM5PR2101MB1015; x-ms-traffictypediagnostic: DM5PR2101MB1015: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231046)(2400081)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1015;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1015; x-forefront-prvs: 056297E276 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(376002)(366004)(39860400002)(346002)(199004)(189003)(478600001)(6666003)(106356001)(6512007)(53936002)(2900100001)(36756003)(102836004)(2950100002)(2501003)(10290500003)(97736004)(14454004)(81166006)(72206003)(8936002)(6486002)(1076002)(10090500001)(6346003)(26005)(54906003)(4326008)(76176011)(99286004)(86362001)(3660700001)(105586002)(6116002)(8676002)(68736007)(22452003)(66066001)(25786009)(6506007)(5660300001)(305945005)(59450400001)(7736002)(3280700002)(5250100002)(2906002)(107886003)(86612001)(6436002)(316002)(81156014)(3846002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1015;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: pVXZbjysKP/w7qkHFxlQ7NNbL8UzxaSNPbsKyYwynALCUmKXql7BJiScGrPAwvGflllGrqPGpENGk7zGEvx2jw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9422ddba-65d2-4daf-76ac-08d562e11501 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2018 04:14:53.0651 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1015 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit fb500a7cfee7f2f447d2bbf30cb59629feab6ac1 ] Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- fs/nfsd/nfs4state.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a439a70177a4..61f38346ce9d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -63,6 +63,9 @@ static const stateid_t zero_stateid =3D { static const stateid_t currentstateid =3D { .si_generation =3D 1, }; +static const stateid_t close_stateid =3D { + .si_generation =3D 0xffffffffU, +}; =20 static u64 current_sessionid =3D 1; =20 @@ -5411,6 +5414,11 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_com= pound_state *cstate, nfsd4_close_open_stateid(stp); mutex_unlock(&stp->st_mutex); =20 + /* 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: --=20 2.11.0