From patchwork Mon Apr 3 12:10:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 9659471 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 24DED60352 for ; Mon, 3 Apr 2017 12:10:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 196BE2003F for ; Mon, 3 Apr 2017 12:10:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E578284BC; Mon, 3 Apr 2017 12:10:36 +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 39CBA2003F for ; Mon, 3 Apr 2017 12:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbdDCMKd (ORCPT ); Mon, 3 Apr 2017 08:10:33 -0400 Received: from smtp-o-3.desy.de ([131.169.56.156]:43838 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbdDCMKc (ORCPT ); Mon, 3 Apr 2017 08:10:32 -0400 X-Clacks-Overhead: GNU Terry Pratchett DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de 7D8B5280270 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1491221430; bh=euCUpcMb68C2TvF1rk9Z+XVZMeZ5sqkaJIhR6Igz7Os=; h=From:To:Cc:Subject:Date:From; b=vXjs9S83unxRIb7WDS9LrR55KZAzRtGF5xeAhCLyy67EjrNM01QfTm0AqK7hgS6p+ cJoCVH7pjy8vvsKRSgU9HXIrXUlvgky7BVQRgKlGyPIRdfoOAlJAWOxoFucZnRBVei iEwxq44mmFHVj01bVleMjsiFA/kzl+w2fJJxIEUc= 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 7D8B5280270 for ; Mon, 3 Apr 2017 14:10:30 +0200 (CEST) Received: from spamfilter3.desy.de (spamfilter3.desy.de [131.169.56.144]) by smtp-map-3.desy.de (DESY_MAP_3) with ESMTP id 6900E1215; Mon, 3 Apr 2017 14:10:30 +0200 (MEST) Received: from spamfilter3.desy.de (localhost [127.0.0.1]) by localhost.domain.tld (DESY MTA) with ESMTP id 1C79118E790; Mon, 3 Apr 2017 14:10:28 +0200 (CEST) Received: from amavis02.desy.de (lb-56-26.desy.de [131.169.56.26]) by spamfilter3.desy.de (DESY MTA) with ESMTP id 162C618E778; Mon, 3 Apr 2017 14:10:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by amavis02.desy.de (Postfix) with ESMTP id 102F2E4; Mon, 3 Apr 2017 14:10:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at desy.de Received: from amavis02.desy.de ([127.0.0.1]) by localhost (amavis02.desy.de [127.0.0.1]) (amavisd-new, port 10027) with ESMTP id wMsbGSOxCSrq; Mon, 3 Apr 2017 14:10:28 +0200 (CEST) Received: from smtp-intra-1.desy.de (lb-56-26.desy.de [131.169.56.26]) by amavis02.desy.de (Postfix) with ESMTP id F2BCAE2; Mon, 3 Apr 2017 14:10:27 +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 EAB633E901; Mon, 3 Apr 2017 14:10:27 +0200 (MEST) From: Tigran Mkrtchyan To: linux-nfs@vger.kernel.org Cc: trond.myklebust@primarydata.com, Tigran Mkrtchyan Subject: [PATCH] nfs: flexfilelayout: remove v3-only data server limitation Date: Mon, 3 Apr 2017 14:10:26 +0200 Message-Id: <20170403121026.14142-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}. 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 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 457cfeb..fac0ef2 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -119,12 +119,18 @@ 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) { - dprintk("%s: [%d] unsupported ds version %d-%d\n", __func__, - i, ds_versions[i].version, - ds_versions[i].minor_version); - ret = -EPROTONOSUPPORT; - goto out_err_drain_dsaddrs; + /* check for valid major minor combination */ + switch (ds_versions[i].version * 100 + ds_versions[i].minor_version) { + case 300: /* v3 */ + case 400: /* v4.0 */ + case 401: /* v4.1 */ + break; + default: + dprintk("%s: [%d] unsupported ds version %d-%d\n", __func__, + i, ds_versions[i].version, + ds_versions[i].minor_version); + ret = -EPROTONOSUPPORT; + goto out_err_drain_dsaddrs; } dprintk("%s: [%d] vers %u minor_ver %u rsize %u wsize %u coupled %d\n",