From patchwork Mon Nov 26 17:35:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 10698869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75E9C15A8 for ; Mon, 26 Nov 2018 17:35:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 636D329F76 for ; Mon, 26 Nov 2018 17:35:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57B5129FD7; Mon, 26 Nov 2018 17:35:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HK_RANDOM_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D795D29F76 for ; Mon, 26 Nov 2018 17:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726346AbeK0EaQ (ORCPT ); Mon, 26 Nov 2018 23:30:16 -0500 Received: from smtp-o-3.desy.de ([131.169.56.156]:37837 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbeK0EaQ (ORCPT ); Mon, 26 Nov 2018 23:30:16 -0500 Received: from smtp-buf-2.desy.de (smtp-buf-2.desy.de [131.169.56.165]) by smtp-o-3.desy.de (DESY-O-3) with ESMTP id 4E99A280739 for ; Mon, 26 Nov 2018 18:35:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de 4E99A280739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1543253727; bh=PV+MD0T7zt7uZs55cMpe6+RAYSHMeJjoJoOIt9pP0lY=; h=From:To:Cc:Subject:Date:From; b=HVldFNbBs76INVY4+Se7LWNaDVZfvPdiBbZeYEZaftDSIHrL00CGSmPyGx0tx41NL UKE/8s8vVilCsT1V6KWcGCHYALB31cBEnBXh7aVcgK0eTX/GWMVvLe2TDJnPAPbzIK WflfNilhHjZ0msHIPk88r2DA++l1WdYVuj3mwWrk= Received: from smtp-m-2.desy.de (smtp-m-2.desy.de [IPv6:2001:638:700:1038::1:82]) by smtp-buf-2.desy.de (Postfix) with ESMTP id 47B171A03D7; Mon, 26 Nov 2018 18:35:27 +0100 (CET) X-Virus-Scanned: amavisd-new at desy.de Received: from anahit.desy.de (anahit.desy.de [131.169.185.68]) by smtp-intra-1.desy.de (DESY-INTRA-1) with ESMTP id 1824B3E901; Mon, 26 Nov 2018 18:35:27 +0100 (MET) From: Tigran Mkrtchyan To: trondmy@hammerspace.com, Anna.Schumaker@Netapp.com Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan Subject: [PATCH 1/1] flexfiles: enforce per-mirror stateid only for v4 DSes Date: Mon, 26 Nov 2018 18:35:14 +0100 Message-Id: <20181126173514.11350-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.17.2 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit bb21ce0ad227 we always enforce per-mirror stateid. However, this makes sense only for v4+ servers. Signed-off-by: Tigran Mkrtchyan --- fs/nfs/flexfilelayout/flexfilelayout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 74b36ed883ca..310d7500f665 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1733,7 +1733,8 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr) if (fh) hdr->args.fh = fh; - if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid)) + if (vers == 4 && + !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid)) goto out_failed; /* @@ -1798,7 +1799,8 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync) if (fh) hdr->args.fh = fh; - if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid)) + if (vers == 4 && + !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid)) goto out_failed; /*