From 4d80fcf5ec2098aa4f5aef07dec80ec9eb5ad602 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 24 Aug 2017 11:34:42 -0700 Subject: nfs: Correctly reconfigure NFS options Summary: A mistake was made in D2519423 where `ret` wasn't being set to `0` at the end of `nfs3_init_subvolume_options` since code was inserted between the final `ret = 0` and the return, causing the function to return phony positive ret values. This causes the code to interpret the reconfigure function as a failure, meaning that changes can't be persisted. This only affects the `reconfigure` path and not the `init` path, since the `reconfigure` path fails when `ret != 0` and the init path only fails when `ret == -1`... Test Plan: See that volume options are actually being set when the `nfs` xlator is alive, instead of simply on init. Reviewers: jdarcy, kvigor, dph, sshreyas Reviewed By: sshreyas Subscribers: #posix_storage Differential Revision: https://phabricator.intern.facebook.com/D5699888 Change-Id: I89006ce3970f22a4206e58ca5630c21df536031c Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/18293 Reviewed-by: Jeff Darcy Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Smoke: Gluster Build System --- xlators/nfs/server/src/nfs3.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 2426028ed2d..bd512200d4b 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -5684,12 +5684,6 @@ no_dvm: if (exp->trusted_sync) exp->trusted_write = 1; - gf_msg_trace (GF_NFS3, 0, "%s: %s, %s, %s", exp->subvol->name, - (exp->access == GF_NFS3_VOLACCESS_RO)?"read-only":"read-write", - (exp->trusted_sync == 0)?"no trusted_sync":"trusted_sync", - (exp->trusted_write == 0)?"no trusted_write":"trusted_write"); - ret = 0; - ret = snprintf (searchkey, 1024, "nfs.%s.exports-auth-enable", name); if (ret < 0) { gf_log (GF_NFS, GF_LOG_ERROR, "snprintf failed"); @@ -5718,6 +5712,12 @@ no_dvm: } } + gf_log (GF_NFS3, GF_LOG_TRACE, "%s: %s, %s, %s", exp->subvol->name, + (exp->access == GF_NFS3_VOLACCESS_RO)?"read-only":"read-write", + (exp->trusted_sync == 0)?"no trusted_sync":"trusted_sync", + (exp->trusted_write == 0)?"no trusted_write":"trusted_write"); + ret = 0; + err: return ret; } -- cgit