From patchwork Tue Apr 4 13:12:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 9661709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 978136032D for ; Tue, 4 Apr 2017 13:13:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60CB20008 for ; Tue, 4 Apr 2017 13:13:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99C242850E; Tue, 4 Apr 2017 13:13:03 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 B566528503 for ; Tue, 4 Apr 2017 13:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbdDDNNB (ORCPT ); Tue, 4 Apr 2017 09:13:01 -0400 Received: from smtp-o-3.desy.de ([131.169.56.156]:48448 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbdDDNNB (ORCPT ); Tue, 4 Apr 2017 09:13:01 -0400 X-Clacks-Overhead: GNU Terry Pratchett DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de 124762804F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1491311578; bh=U1v189stWV261LJrCpl/Emm9m+5nuZACpa8GEa56nHI=; h=From:To:Cc:Subject:Date:From; b=TlDePU2RMdplLCxUzVCGl1WzhI3xueaH7/8SeNwP5ywFrsCOadp5T/L09GGY4L6sz 30ne9nhdHJKps8sqUgJ6O1Uk7vmsv79pmPaLKwQON+xslxcHXYEi2z+y3zUNK0l1jq 2AFZRykyxb7IXN0IDnL0s+k24STLZEugA0flV0SU= Received: from smtp-map-3.desy.de (smtp-map-3.desy.de [131.169.56.68]) by smtp-o-3.desy.de (DESY-O-3) with ESMTP id 124762804F3 for ; Tue, 4 Apr 2017 15:12:58 +0200 (CEST) Received: from spamfilter2.desy.de (spamfilter2.desy.de [131.169.56.143]) by smtp-map-3.desy.de (DESY_MAP_3) with ESMTP id F25301364; Tue, 4 Apr 2017 15:12:57 +0200 (MEST) Received: from spamfilter2.desy.de (localhost [127.0.0.1]) by localhost.domain.tld (DESY MTA) with ESMTP id BE5B118E721; Tue, 4 Apr 2017 15:12:56 +0200 (CEST) Received: from amavis01.desy.de (lb-56-26.desy.de [131.169.56.26]) by spamfilter2.desy.de (DESY MTA) with ESMTP id BCA2018E71F; Tue, 4 Apr 2017 15:12:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by amavis01.desy.de (Postfix) with ESMTP id B2E523FAE6; Tue, 4 Apr 2017 15:12:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at desy.de Received: from amavis01.desy.de ([127.0.0.1]) by localhost (amavis01.desy.de [127.0.0.1]) (amavisd-new, port 10027) with ESMTP id UuS7zUCJlA4g; Tue, 4 Apr 2017 15:12:56 +0200 (CEST) Received: from smtp-intra-1.desy.de (lb-56-26.desy.de [131.169.56.26]) by amavis01.desy.de (Postfix) with ESMTP id A12B13FAE0; Tue, 4 Apr 2017 15:12:56 +0200 (CEST) Received: from anahit.desy.de (anahit.desy.de [131.169.185.68]) by smtp-intra-1.desy.de (DESY-INTRA-1) with ESMTP id 8D4CB3E901; Tue, 4 Apr 2017 15:12:56 +0200 (MEST) From: Tigran Mkrtchyan To: linux-nfs@vger.kernel.org Cc: trond.myklebust@primarydata.com, Tigran Mkrtchyan Subject: [PATCH v2] nfs: flexfilelayout: remove v3-only data server limitation Date: Tue, 4 Apr 2017 15:12:51 +0200 Message-Id: <20170404131251.14212-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.9.3 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 Flexfilelayout supports data servers which talk NFS v3 and v4.{0,1,2}. However, this code path is disabled and v3 only servers are accepted. This change removes this limitation. Signed-off-by: Tigran Mkrtchyan --- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 457cfeb..aae05fc 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -119,7 +119,13 @@ nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, if (ds_versions[i].wsize > NFS_MAX_FILE_IO_SIZE) ds_versions[i].wsize = NFS_MAX_FILE_IO_SIZE; - if (ds_versions[i].version != 3 || ds_versions[i].minor_version != 0) { + /* + * check for valid major/minor combination. + * currently we support dataserver which talk: + * v3, v4.0, v4.1, v4.2 + */ + if (!((ds_versions[i].version == 3 && ds_versions[i].minor_version == 0) || + (ds_versions[i].version == 4 && ds_versions[i].minor_version < 3))) { dprintk("%s: [%d] unsupported ds version %d-%d\n", __func__, i, ds_versions[i].version, ds_versions[i].minor_version);