diff mbox

[v2] nfs: flexfilelayout: remove v3-only data server limitation

Message ID 20170404131251.14212-1-tigran.mkrtchyan@desy.de (mailing list archive)
State New, archived
Headers show

Commit Message

Mkrtchyan, Tigran April 4, 2017, 1:12 p.m. UTC
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 <tigran.mkrtchyan@desy.de>
---
 fs/nfs/flexfilelayout/flexfilelayoutdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Weston Andros Adamson April 4, 2017, 2:22 p.m. UTC | #1
Looks good to me! Thanks!

-dros

> On Apr 4, 2017, at 9:12 AM, Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> wrote:
> 
> 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 <tigran.mkrtchyan@desy.de>
> ---
> 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);
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);