diff options
66 files changed, 140 insertions, 66 deletions
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index e1f96a75626..f6fc8de16de 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -66,6 +66,8 @@ #define GD_OP_VERSION_3_7_12 30712 /* Op-version for GlusterFS 3.7.12 */ +#define GD_OP_VERSION_3_8_0 30800 /* Op-version for GlusterFS 3.8.0 */ + #define GD_OP_VERSION_4_0_0 40000 /* Op-version for GlusterFS 4.0.0 */ #define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0 diff --git a/tests/basic/afr/arbiter-mount.t b/tests/basic/afr/arbiter-mount.t index 7276285202f..587e808863f 100644 --- a/tests/basic/afr/arbiter-mount.t +++ b/tests/basic/afr/arbiter-mount.t @@ -12,6 +12,7 @@ TEST glusterd; TEST pidof glusterd TEST $CLI volume create $V0 replica 3 arbiter 1 $H0:$B0/${V0}{0,1,2} +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT 'Started' volinfo_field $V0 'Status' EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/basic/ec/nfs.t b/tests/basic/ec/nfs.t index 16e88c1460b..f0bdff93d5f 100755 --- a/tests/basic/ec/nfs.t +++ b/tests/basic/ec/nfs.t @@ -9,6 +9,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 redundancy 2 $H0:$B0/${V0}{0..5} EXPECT "Created" volinfo_field $V0 'Status' +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Started" volinfo_field $V0 'Status' diff --git a/tests/basic/mount-nfs-auth.t b/tests/basic/mount-nfs-auth.t index 6ecac5b469a..9df5cb45c3b 100755 --- a/tests/basic/mount-nfs-auth.t +++ b/tests/basic/mount-nfs-auth.t @@ -132,9 +132,16 @@ function stat_nfs () { # Restarts the NFS server function restart_nfs () { - # disabling nfs acces for a volume requires a restart - $CLI volume set patchy nfs.disable true - $CLI volume reset patchy nfs.disable + local NFS_PID=$(cat ${GLUSTERD_WORKDIR}/nfs/run/nfs.pid) + + # kill the NFS-server if it is running + while ps -q ${NFS_PID} 2>&1 > /dev/null; do + kill ${NFS_PID} + sleep 0.5 + done + + # start-force starts the NFS-server again + $CLI vol start patchy force } setup_cluster diff --git a/tests/basic/mount.t b/tests/basic/mount.t index 47d0efe3908..52e760d048d 100755 --- a/tests/basic/mount.t +++ b/tests/basic/mount.t @@ -12,6 +12,7 @@ TEST pidof glusterd TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume set $V0 nfs.disable false function volinfo_field() { diff --git a/tests/basic/nufa.t b/tests/basic/nufa.t index ca4054a354d..1d74d376b7d 100644 --- a/tests/basic/nufa.t +++ b/tests/basic/nufa.t @@ -11,6 +11,7 @@ TEST pidof glusterd TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume set $V0 nfs.disable false EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; diff --git a/tests/basic/quota-anon-fd-nfs.t b/tests/basic/quota-anon-fd-nfs.t index e2cce0b69c2..c6b01553b02 100755 --- a/tests/basic/quota-anon-fd-nfs.t +++ b/tests/basic/quota-anon-fd-nfs.t @@ -18,6 +18,7 @@ TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/brick1; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false # The test makes use of inode-lru-limit to hit a scenario, where we diff --git a/tests/basic/quota-nfs.t b/tests/basic/quota-nfs.t index 16d5aa6a90c..74fde400bd1 100755 --- a/tests/basic/quota-nfs.t +++ b/tests/basic/quota-nfs.t @@ -15,6 +15,7 @@ TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/brick1; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume set $V0 network.inode-lru-limit 1 TEST $CLI volume set $V0 performance.nfs.write-behind off diff --git a/tests/basic/quota.t b/tests/basic/quota.t index 887fbfc32bc..5a03fa25683 100755 --- a/tests/basic/quota.t +++ b/tests/basic/quota.t @@ -24,6 +24,7 @@ EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '4' brick_count $V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; diff --git a/tests/basic/stats-dump.t b/tests/basic/stats-dump.t index 0a680e44e55..7da6e0605a4 100644 --- a/tests/basic/stats-dump.t +++ b/tests/basic/stats-dump.t @@ -14,7 +14,7 @@ TEST $CLI volume set $V0 diagnostics.count-fop-hits on TEST $CLI volume set $V0 diagnostics.stats-dump-interval 1 TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume start $V0 -sleep 1 +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 TEST mount_nfs $H0:/$V0 $N0 nolock,soft,intr diff --git a/tests/basic/uss.t b/tests/basic/uss.t index 55fab660aa2..6cfc0303895 100644 --- a/tests/basic/uss.t +++ b/tests/basic/uss.t @@ -34,6 +34,8 @@ TEST glusterd; TEST pidof glusterd; TEST $CLI volume create $V0 $H0:$L1 $H0:$L2 $H0:$L3; +TEST $CLI volume set $V0 nfs.disable false + TEST $CLI volume start $V0; diff --git a/tests/basic/volume-status.t b/tests/basic/volume-status.t index 7d1b8326e3c..f87b0a93edf 100644 --- a/tests/basic/volume-status.t +++ b/tests/basic/volume-status.t @@ -11,6 +11,7 @@ TEST pidof glusterd TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; diff --git a/tests/bitrot/br-stub.t b/tests/bitrot/br-stub.t index eb0c55caa36..56b0960e074 100644 --- a/tests/bitrot/br-stub.t +++ b/tests/bitrot/br-stub.t @@ -17,6 +17,7 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2; EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '2' brick_count $V0 +TEST $CLI volume set $V0 nfs.disable false ## Turn off write-behind (write-behind clubs writes together) TEST $CLI volume set $V0 performance.write-behind off diff --git a/tests/bitrot/bug-1244613.t b/tests/bitrot/bug-1244613.t index 000a1d358e9..a1812e61f6e 100644 --- a/tests/bitrot/bug-1244613.t +++ b/tests/bitrot/bug-1244613.t @@ -14,7 +14,7 @@ TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/brick1; EXPECT 'Created' volinfo_field $V0 'Status'; - +TEST $CLI volume set $V0 nfs.disable false # The test makes use of inode-lru-limit to hit a scenario, where we # find an inode whose ancestry is not there. Following is the diff --git a/tests/bugs/access-control/bug-958691.t b/tests/bugs/access-control/bug-958691.t index 9db858da2d2..6c45b47b166 100644 --- a/tests/bugs/access-control/bug-958691.t +++ b/tests/bugs/access-control/bug-958691.t @@ -8,6 +8,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1} +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; diff --git a/tests/bugs/bug-1110262.t b/tests/bugs/bug-1110262.t index b6051935b7f..9c6e4f973a1 100644 --- a/tests/bugs/bug-1110262.t +++ b/tests/bugs/bug-1110262.t @@ -12,6 +12,7 @@ TEST $CLI volume info; ## Lets create volume TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; +TEST $CLI volume set $V0 nfs.disable false ## Verify volume is created EXPECT "$V0" volinfo_field $V0 'Volume Name'; diff --git a/tests/bugs/core/bug-927616.t b/tests/bugs/core/bug-927616.t index 811e88f952f..6bb64743183 100755 --- a/tests/bugs/core/bug-927616.t +++ b/tests/bugs/core/bug-927616.t @@ -9,6 +9,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; TEST $CLI volume set $V0 performance.open-behind off; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 ## Mount FUSE with caching disabled diff --git a/tests/bugs/disperse/bug-1187474.t b/tests/bugs/disperse/bug-1187474.t index dce0100de57..fb4b2082f8f 100644 --- a/tests/bugs/disperse/bug-1187474.t +++ b/tests/bugs/disperse/bug-1187474.t @@ -22,6 +22,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 redundancy 2 $H0:$B0/${V0}{0..5} EXPECT "Created" volinfo_field $V0 'Status' +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Started" volinfo_field $V0 'Status' EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available diff --git a/tests/bugs/distribute/bug-1125824.t b/tests/bugs/distribute/bug-1125824.t index a944b360db3..3bafbf31fe5 100755 --- a/tests/bugs/distribute/bug-1125824.t +++ b/tests/bugs/distribute/bug-1125824.t @@ -54,6 +54,7 @@ EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '4' brick_count $V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; diff --git a/tests/bugs/distribute/bug-1161156.t b/tests/bugs/distribute/bug-1161156.t index 572338a2257..44a234c60dc 100755 --- a/tests/bugs/distribute/bug-1161156.t +++ b/tests/bugs/distribute/bug-1161156.t @@ -17,6 +17,7 @@ TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6}; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; diff --git a/tests/bugs/distribute/bug-1190734.t b/tests/bugs/distribute/bug-1190734.t index ae34ec84729..d48d74d2c35 100644 --- a/tests/bugs/distribute/bug-1190734.t +++ b/tests/bugs/distribute/bug-1190734.t @@ -62,6 +62,7 @@ TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 \ $H0:$B0/${V0}2 $H0:$B0/${V0}3 $H0:$B0/${V0}4 $H0:$B0/${V0}5 +TEST $CLI volume set $V0 nfs.disable false # ------- test 1: AFR, fuse + remove bricks @@ -77,6 +78,7 @@ reset $M0 TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 \ $H0:$B0/${V0}2 $H0:$B0/${V0}3 $H0:$B0/${V0}4 $H0:$B0/${V0}5 +TEST $CLI volume set $V0 nfs.disable false TEST start_mount_nfs test2 EXPECT_WITHIN $FILE_COUNT_TIME $FILE_COUNT get_file_count $N0/test2 diff --git a/tests/bugs/fuse/bug-858215.t b/tests/bugs/fuse/bug-858215.t index b33b8d4971b..c8613efb72e 100755 --- a/tests/bugs/fuse/bug-858215.t +++ b/tests/bugs/fuse/bug-858215.t @@ -11,6 +11,7 @@ TEST pidof glusterd; TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume set $V0 nfs.disable off function volinfo_field() { diff --git a/tests/bugs/fuse/many-groups-for-acl.t b/tests/bugs/fuse/many-groups-for-acl.t index d83fe12644a..d959f750ee0 100755 --- a/tests/bugs/fuse/many-groups-for-acl.t +++ b/tests/bugs/fuse/many-groups-for-acl.t @@ -43,6 +43,7 @@ TEST useradd -o -M -u ${NEW_UID} -g ${NEW_GID} -G ${NEW_USER}-${NEW_GIDS} ${NEW_ TEST glusterd TEST pidof glusterd TEST $CLI volume create ${V0} ${H0}:${B0}/${V0}1 +TEST $CLI volume set $V0 nfs.disable off # disable manage-gids on the server-side for now, gets enabled later TEST $CLI volume set ${V0} server.manage-gids off TEST $CLI volume start ${V0} diff --git a/tests/bugs/glusterd/bug-1070734.t b/tests/bugs/glusterd/bug-1070734.t index 5db60e0cfe6..ea160d7ec6b 100755 --- a/tests/bugs/glusterd/bug-1070734.t +++ b/tests/bugs/glusterd/bug-1070734.t @@ -17,6 +17,7 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; ## Verify volume is created EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false ## Start volume and verify TEST $CLI volume start $V0; diff --git a/tests/bugs/glusterd/bug-1209329_daemon-svcs-on-reset-volume.t b/tests/bugs/glusterd/bug-1209329_daemon-svcs-on-reset-volume.t index aa24cf1c3f5..f6ca953e40b 100644 --- a/tests/bugs/glusterd/bug-1209329_daemon-svcs-on-reset-volume.t +++ b/tests/bugs/glusterd/bug-1209329_daemon-svcs-on-reset-volume.t @@ -39,14 +39,17 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_snapd_count TEST $CLI volume reset $V0 force; EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" get_snapd_count -#enable nfs.disable options and verify -TEST $CLI volume set $V0 nfs.disable on -EXPECT 'on' volinfo_field $V0 'nfs.disable' -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" get_nfs_count +##verify initial nfs disabled by default +EXPECT "0" get_nfs_count + +##enable nfs and verify +TEST $CLI volume set $V0 nfs.disable off +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available +EXPECT "1" get_nfs_count ##Do reset force which set the nfs.option to default TEST $CLI volume reset $V0 force; -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_nfs_count +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" get_nfs_count ##enable the uss option and verify snapd is running or not TEST $CLI volume set $V0 features.uss on diff --git a/tests/bugs/glusterd/bug-1260185-donot-allow-detach-commit-unnecessarily.t b/tests/bugs/glusterd/bug-1260185-donot-allow-detach-commit-unnecessarily.t index 4ef4c9d14ad..4798959380e 100644 --- a/tests/bugs/glusterd/bug-1260185-donot-allow-detach-commit-unnecessarily.t +++ b/tests/bugs/glusterd/bug-1260185-donot-allow-detach-commit-unnecessarily.t @@ -19,23 +19,25 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2} TEST $CLI volume start $V0 ## Perform attach-tier operation on volume $V0 -TEST $CLI volume attach-tier $V0 $H0:$B0/${V0}{3..4} +TEST $CLI volume tier $V0 attach $H0:$B0/${V0}{3..4} ## detach-tier commit operation without force option on volume $V0 ## should not succeed -TEST ! $CLI volume detach-tier $V0 commit +TEST ! $CLI --mode=script volume tier $V0 detach commit ## detach-tier commit operation with force option on volume $V0 ## should succeed -TEST $CLI volume detach-tier $V0 force +TEST $CLI volume tier $V0 detach force + +sleep 3 ## Again performing attach-tier operation on volume $V0 -TEST $CLI volume attach-tier $V0 $H0:$B0/${V0}{5..6} +TEST $CLI volume tier $V0 attach $H0:$B0/${V0}{5..6} ## Do detach-tier start on volume $V0 -TEST $CLI volume detach-tier $V0 start +TEST $CLI volume tier $V0 detach start ## Now detach-tier commit on volume $V0 should succeed. -TEST $CLI volume detach-tier $V0 commit +TEST $CLI volume tier $V0 detach commit cleanup; diff --git a/tests/bugs/glusterd/bug-949930.t b/tests/bugs/glusterd/bug-949930.t index 774802a66b2..9a6d38fa37f 100644 --- a/tests/bugs/glusterd/bug-949930.t +++ b/tests/bugs/glusterd/bug-949930.t @@ -10,9 +10,11 @@ TEST glusterd; TEST pidof glusterd; TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume start $V0; TEST $CLI volume create $V1 $H0:$B0/${V1}{1,2}; +TEST $CLI volume set $V1 nfs.disable off TEST $CLI volume start $V1; TEST ! $CLI volume set $V0 performance.nfs.read-ahead blah diff --git a/tests/bugs/glusterfs-server/bug-864222.t b/tests/bugs/glusterfs-server/bug-864222.t index cbda7d27f38..3a46c283599 100755 --- a/tests/bugs/glusterfs-server/bug-864222.t +++ b/tests/bugs/glusterfs-server/bug-864222.t @@ -9,6 +9,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/brick0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/glusterfs-server/bug-887145.t b/tests/bugs/glusterfs-server/bug-887145.t index 35e1c928390..9b940259f55 100755 --- a/tests/bugs/glusterfs-server/bug-887145.t +++ b/tests/bugs/glusterfs-server/bug-887145.t @@ -9,6 +9,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; TEST $CLI volume set $V0 performance.open-behind off; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 ## Mount FUSE with caching disabled diff --git a/tests/bugs/glusterfs-server/bug-904300.t b/tests/bugs/glusterfs-server/bug-904300.t index 8ce805cfcdd..eea1c5b5463 100755 --- a/tests/bugs/glusterfs-server/bug-904300.t +++ b/tests/bugs/glusterfs-server/bug-904300.t @@ -11,6 +11,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/$V0; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available diff --git a/tests/bugs/glusterfs/bug-867253.t b/tests/bugs/glusterfs/bug-867253.t index 41972a7731b..acbbdf8c1e7 100644 --- a/tests/bugs/glusterfs/bug-867253.t +++ b/tests/bugs/glusterfs/bug-867253.t @@ -26,6 +26,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/glusterfs/bug-872923.t b/tests/bugs/glusterfs/bug-872923.t index de24117a037..72e8f230864 100755 --- a/tests/bugs/glusterfs/bug-872923.t +++ b/tests/bugs/glusterfs/bug-872923.t @@ -10,6 +10,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume info TEST $CLI volume create $V0 replica 2 $H0:$B0/brick0 $H0:$B0/brick1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/nfs/bug-1053579.t b/tests/bugs/nfs/bug-1053579.t index 81e786d2ec6..f616eb2baa5 100755 --- a/tests/bugs/nfs/bug-1053579.t +++ b/tests/bugs/nfs/bug-1053579.t @@ -42,6 +42,7 @@ TEST useradd -o -M -u ${NEW_UID} -g ${NEW_GID} -G ${NEW_USER}-${NEW_GIDS} ${NEW_ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume set $V0 nfs.server-aux-gids on TEST $CLI volume start $V0 diff --git a/tests/bugs/nfs/bug-1116503.t b/tests/bugs/nfs/bug-1116503.t index 5527f768b45..c9ed840ec92 100644 --- a/tests/bugs/nfs/bug-1116503.t +++ b/tests/bugs/nfs/bug-1116503.t @@ -13,6 +13,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume set $V0 nfs.mount-udp on TEST $CLI volume start $V0 diff --git a/tests/bugs/nfs/bug-1143880-fix-gNFSd-auth-crash.t b/tests/bugs/nfs/bug-1143880-fix-gNFSd-auth-crash.t index 1a9270286fb..b194b3744b4 100644 --- a/tests/bugs/nfs/bug-1143880-fix-gNFSd-auth-crash.t +++ b/tests/bugs/nfs/bug-1143880-fix-gNFSd-auth-crash.t @@ -7,6 +7,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2} +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume set $V0 performance.open-behind off TEST $CLI volume start $V0 diff --git a/tests/bugs/nfs/bug-1157223-symlink-mounting.t b/tests/bugs/nfs/bug-1157223-symlink-mounting.t index 469b221f5b3..740d638193d 100644 --- a/tests/bugs/nfs/bug-1157223-symlink-mounting.t +++ b/tests/bugs/nfs/bug-1157223-symlink-mounting.t @@ -11,7 +11,7 @@ TEST pidof glusterd TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/$V0 - +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; ## Wait for volume to register with rpc.mountd diff --git a/tests/bugs/nfs/bug-1161092-nfs-acls.t b/tests/bugs/nfs/bug-1161092-nfs-acls.t index ed7761db3e3..1304ad905bf 100644 --- a/tests/bugs/nfs/bug-1161092-nfs-acls.t +++ b/tests/bugs/nfs/bug-1161092-nfs-acls.t @@ -11,6 +11,7 @@ TEST $CLI volume info TEST $CLI volume create $V0 $H0:$B0/brick1; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; diff --git a/tests/bugs/nfs/bug-1166862.t b/tests/bugs/nfs/bug-1166862.t index c8f63d50b0c..f986fe36ab7 100755 --- a/tests/bugs/nfs/bug-1166862.t +++ b/tests/bugs/nfs/bug-1166862.t @@ -28,6 +28,7 @@ TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/brick1 EXPECT 'Created' volinfo_field $V0 'Status' +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status' diff --git a/tests/bugs/nfs/bug-1210338.t b/tests/bugs/nfs/bug-1210338.t index cdac24e3e8e..4232b9d8748 100644 --- a/tests/bugs/nfs/bug-1210338.t +++ b/tests/bugs/nfs/bug-1210338.t @@ -13,6 +13,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; TEST mount_nfs $H0:/$V0 $N0 nolock diff --git a/tests/bugs/nfs/bug-847622.t b/tests/bugs/nfs/bug-847622.t index 22167e87e50..3b836745a07 100755 --- a/tests/bugs/nfs/bug-847622.t +++ b/tests/bugs/nfs/bug-847622.t @@ -19,6 +19,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/brick0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/nfs/bug-877885.t b/tests/bugs/nfs/bug-877885.t index 47eb396b532..a47893d7fcb 100755 --- a/tests/bugs/nfs/bug-877885.t +++ b/tests/bugs/nfs/bug-877885.t @@ -9,6 +9,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/brick0 $H0:$B0/brick1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 ## Mount FUSE with caching disabled diff --git a/tests/bugs/nfs/bug-904065.t b/tests/bugs/nfs/bug-904065.t index ff6797bcbec..0becb756da4 100755 --- a/tests/bugs/nfs/bug-904065.t +++ b/tests/bugs/nfs/bug-904065.t @@ -30,6 +30,7 @@ TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/brick1 EXPECT 'Created' volinfo_field $V0 'Status' +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status' diff --git a/tests/bugs/nfs/bug-915280.t b/tests/bugs/nfs/bug-915280.t index 72bdf2c0d9c..d70c36f0a53 100755 --- a/tests/bugs/nfs/bug-915280.t +++ b/tests/bugs/nfs/bug-915280.t @@ -19,6 +19,7 @@ function volinfo_field() TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2; EXPECT 'Created' volinfo_field $V0 'Status'; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT 'Started' volinfo_field $V0 'Status'; diff --git a/tests/bugs/nfs/bug-974972.t b/tests/bugs/nfs/bug-974972.t index 9ed19915a67..d05e7df1a9f 100755 --- a/tests/bugs/nfs/bug-974972.t +++ b/tests/bugs/nfs/bug-974972.t @@ -11,6 +11,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} TEST $CLI volume set $V0 self-heal-daemon off +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; TEST mount_nfs $H0:/$V0 $N0 diff --git a/tests/bugs/nfs/socket-as-fifo.t b/tests/bugs/nfs/socket-as-fifo.t index 94a800a2ceb..ca5f2af6f2b 100644 --- a/tests/bugs/nfs/socket-as-fifo.t +++ b/tests/bugs/nfs/socket-as-fifo.t @@ -10,6 +10,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; TEST mount_nfs $H0:/$V0 $N0 nolock diff --git a/tests/bugs/quota/bug-1087198.t b/tests/bugs/quota/bug-1087198.t index 1acf656e091..0694b251d9f 100644 --- a/tests/bugs/quota/bug-1087198.t +++ b/tests/bugs/quota/bug-1087198.t @@ -28,7 +28,7 @@ build_tester $(dirname $0)/../../basic/quota.c -o $QDD TEST glusterd TEST $CLI volume create $V0 $H0:$B0/brick{1..4}; - +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/quota/bug-1153964.t b/tests/bugs/quota/bug-1153964.t index 37f34536645..d84a9b36d26 100644 --- a/tests/bugs/quota/bug-1153964.t +++ b/tests/bugs/quota/bug-1153964.t @@ -43,6 +43,7 @@ cleanup; TEST glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 TEST $CLI volume quota $V0 enable diff --git a/tests/bugs/quota/bug-1243798.t b/tests/bugs/quota/bug-1243798.t index c5def297102..53f8b10adba 100644 --- a/tests/bugs/quota/bug-1243798.t +++ b/tests/bugs/quota/bug-1243798.t @@ -9,7 +9,7 @@ cleanup; TEST glusterd TEST $CLI volume create $V0 $H0:$B0/$V0 - +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/replicate/bug-830665.t b/tests/bugs/replicate/bug-830665.t index 3d2ec1145da..c748c1304bf 100755 --- a/tests/bugs/replicate/bug-830665.t +++ b/tests/bugs/replicate/bug-830665.t @@ -18,6 +18,7 @@ TEST $CLI volume info; recreate ${B0}/${V0}-0 recreate ${B0}/${V0}-1 TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}-{0,1} +TEST $CLI volume set $V0 nfs.disable false function volinfo_field() { diff --git a/tests/bugs/replicate/bug-966018.t b/tests/bugs/replicate/bug-966018.t index ec3beb15d56..1b5296b498b 100644 --- a/tests/bugs/replicate/bug-966018.t +++ b/tests/bugs/replicate/bug-966018.t @@ -16,6 +16,7 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/r2_0 $H0:$B0/r2_1 TEST $CLI volume set $V0 ensure-durability off TEST $CLI volume set $V0 cluster.eager-lock on TEST $CLI volume set $V0 cluster.post-op-delay-secs 3 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 TEST $CLI volume profile $V0 start diff --git a/tests/bugs/rpc/bug-1043886.t b/tests/bugs/rpc/bug-1043886.t index e6bd45440b9..b18680289ae 100755 --- a/tests/bugs/rpc/bug-1043886.t +++ b/tests/bugs/rpc/bug-1043886.t @@ -8,6 +8,7 @@ cleanup; TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 ## Mount FUSE with caching disabled diff --git a/tests/bugs/rpc/bug-847624.t b/tests/bugs/rpc/bug-847624.t index 627c47b335f..31a63b56a34 100755 --- a/tests/bugs/rpc/bug-847624.t +++ b/tests/bugs/rpc/bug-847624.t @@ -10,6 +10,7 @@ TEST glusterd TEST pidof glusterd #3 TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume set $V0 nfs.drc on TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; diff --git a/tests/bugs/rpc/bug-921072.t b/tests/bugs/rpc/bug-921072.t index 46a3442f180..458996b57bf 100755 --- a/tests/bugs/rpc/bug-921072.t +++ b/tests/bugs/rpc/bug-921072.t @@ -11,6 +11,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available TEST mount_nfs $H0:/$V0 $N0 nolock @@ -29,7 +30,8 @@ TEST $CLI volume set $V0 nfs.rpc-auth-allow 192.168.1.1 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available #11 TEST ! mount_nfs localhost:/$V0 $N0 nolock -TEST $CLI volume reset --mode=script $V0 +TEST $CLI volume reset $V0 force +TEST $CLI volume set $V0 nfs.disable off # case 3: reject only localhost ip TEST $CLI volume set $V0 nfs.rpc-auth-reject 127.0.0.1 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available @@ -47,7 +49,8 @@ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 # NEED TO CHECK BOTH IP AND NAME BASED AUTH. # CASES WITH NFS.ADDR-NAMELOOKUP ON (5-12) -TEST $CLI volume reset --mode=script $V0 +TEST $CLI volume reset $V0 force +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume set $V0 nfs.addr-namelookup on EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available #20 @@ -68,7 +71,8 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available TEST ! mount_nfs localhost:/$V0 $N0 nolock # case 7: reject only localhost -TEST $CLI volume reset --mode=script $V0 +TEST $CLI volume reset $V0 force +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume set $V0 nfs.addr-namelookup on TEST $CLI volume set $V0 nfs.rpc-auth-reject localhost EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available @@ -84,7 +88,8 @@ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 # based on ip addresses: repeat of cases 1-4 # case 9: allow only localhost ip -TEST $CLI volume reset --mode=script $V0 +TEST $CLI volume reset $V0 force +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume set $V0 nfs.addr-namelookup on TEST $CLI volume set $V0 nfs.rpc-auth-allow 127.0.0.1 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available @@ -100,7 +105,8 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available TEST ! mount_nfs localhost:/$V0 $N0 nolock # case 11: reject only localhost ip -TEST $CLI volume reset --mode=script $V0 +TEST $CLI volume reset $V0 force +TEST $CLI volume set $V0 nfs.disable off TEST $CLI volume set $V0 nfs.addr-namelookup on TEST $CLI volume set $V0 nfs.rpc-auth-reject 127.0.0.1 EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available diff --git a/tests/bugs/snapshot/bug-1166197.t b/tests/bugs/snapshot/bug-1166197.t index 739839fab81..7350acfa9ed 100755 --- a/tests/bugs/snapshot/bug-1166197.t +++ b/tests/bugs/snapshot/bug-1166197.t @@ -15,6 +15,7 @@ TEST pidof glusterd; TEST setup_lvm 1 TEST $CLI volume create $V0 $H0:$L1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 TEST $CLI snapshot config activate-on-create enable TEST $CLI volume set $V0 features.uss enable diff --git a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t index 0893826b343..3776451c158 100644 --- a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t +++ b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t @@ -72,6 +72,7 @@ TEST setup_lvm 1 TEST glusterd TEST $CLI volume create $V0 $H0:$L1 +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 # Mount the volume as both fuse and nfs mount diff --git a/tests/bugs/snapshot/bug-1260848.t b/tests/bugs/snapshot/bug-1260848.t index 9963b293604..7eae3982e43 100644 --- a/tests/bugs/snapshot/bug-1260848.t +++ b/tests/bugs/snapshot/bug-1260848.t @@ -11,6 +11,7 @@ TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5} +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume set $V0 uss on TEST $CLI volume start $V0 diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c index ddbb7446cda..821cd6feb39 100644 --- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c +++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c @@ -689,7 +689,7 @@ start_ganesha (char **op_errstr) vol_opts = volinfo->dict; /* Gluster-nfs has to be disabled across the trusted pool */ /* before attempting to start nfs-ganesha */ - ret = dict_set_str (vol_opts, "nfs.disable", "on"); + ret = dict_set_str (vol_opts, NFS_DISABLE_MAP_KEY, "on"); if (ret) goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index f10d3cec4cd..e2f3f5661cd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -1504,7 +1504,7 @@ glusterd_handle_cli_list_friends (rpcsvc_request_t *req) __glusterd_handle_cli_list_friends); } -int +static int __glusterd_handle_cli_get_volume (rpcsvc_request_t *req) { int32_t ret = -1; @@ -1524,9 +1524,7 @@ __glusterd_handle_cli_get_volume (rpcsvc_request_t *req) goto out; } - gf_msg ("glusterd", GF_LOG_INFO, 0, - GD_MSG_GET_VOL_REQ_RCVD, - "Received get vol req"); + gf_msg_plain (GF_LOG_INFO, "Received get vol req"); if (cli_req.dict.dict_len) { /* Unserialize the dictionary */ @@ -1944,7 +1942,7 @@ glusterd_handle_ganesha_cmd (rpcsvc_request_t *req) return glusterd_big_locked_handler (req, __glusterd_handle_ganesha_cmd); } -int +static int __glusterd_handle_reset_volume (rpcsvc_request_t *req) { int32_t ret = -1; @@ -1959,6 +1957,8 @@ __glusterd_handle_reset_volume (rpcsvc_request_t *req) this = THIS; GF_ASSERT (this); + gf_msg_plain (GF_LOG_DEBUG, "Received reset vol req"); + ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req); if (ret < 0) { snprintf (err_str, sizeof (err_str), "Failed to decode request " diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c index ea24c1e1d25..60b792ffac2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c +++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c @@ -17,15 +17,7 @@ #include "glusterd-messages.h" #include "glusterd-svc-helper.h" -char *nfs_svc_name = "nfs"; - -void -glusterd_nfssvc_build (glusterd_svc_t *svc) -{ - svc->manager = glusterd_nfssvc_manager; - svc->start = glusterd_nfssvc_start; - svc->stop = glusterd_nfssvc_stop; -} +static char *nfs_svc_name = "nfs"; static gf_boolean_t glusterd_nfssvc_need_start () @@ -40,7 +32,7 @@ glusterd_nfssvc_need_start () if (!glusterd_is_volume_started (volinfo)) continue; - if (dict_get_str_boolean (volinfo->dict, "nfs.disable", 0)) + if (dict_get_str_boolean (volinfo->dict, NFS_DISABLE_MAP_KEY, 1)) continue; start = _gf_true; break; @@ -67,7 +59,7 @@ glusterd_nfssvc_create_volfile () filepath, NULL); } -int +static int glusterd_nfssvc_manager (glusterd_svc_t *svc, void *data, int flags) { int ret = -1; @@ -108,15 +100,13 @@ out: return ret; } -int +static int glusterd_nfssvc_start (glusterd_svc_t *svc, int flags) { return glusterd_svc_start (svc, flags, NULL); - - return 0; } -int +static int glusterd_nfssvc_stop (glusterd_svc_t *svc, int sig) { int ret = -1; @@ -137,6 +127,14 @@ out: return ret; } +void +glusterd_nfssvc_build (glusterd_svc_t *svc) +{ + svc->manager = glusterd_nfssvc_manager; + svc->start = glusterd_nfssvc_start; + svc->stop = glusterd_nfssvc_stop; +} + int glusterd_nfssvc_reconfigure () { diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h index 6b803ba6874..6330b71ba7d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h +++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.h @@ -20,15 +20,6 @@ int glusterd_nfssvc_init (glusterd_svc_t *svc); int -glusterd_nfssvc_manager (glusterd_svc_t *svc, void *data, int flags); - -int -glusterd_nfssvc_start (glusterd_svc_t *svc, int flags); - -int -glusterd_nfssvc_stop (glusterd_svc_t *svc, int sig); - -int glusterd_nfssvc_reconfigure (); #endif diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 339195b00e6..f3c0f1a5216 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -399,8 +399,6 @@ static char *glusterd_op_sm_event_names[] = { "GD_OP_EVENT_INVALID" }; -extern struct volopt_map_entry glusterd_volopt_map[]; - char* glusterd_op_sm_state_name_get (int state) { @@ -1661,7 +1659,8 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) vol_opts = volinfo->dict; if ((cmd & GF_CLI_STATUS_NFS) != 0) { - nfs_disabled = dict_get_str_boolean (vol_opts, "nfs.disable", + nfs_disabled = dict_get_str_boolean (vol_opts, + NFS_DISABLE_MAP_KEY, _gf_false); if (nfs_disabled) { ret = -1; @@ -3295,7 +3294,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, } nfs_disabled = dict_get_str_boolean (vol_opts, - "nfs.disable", + NFS_DISABLE_MAP_KEY, _gf_false); if (!nfs_disabled) { ret = glusterd_add_node_to_dict diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c index 7cb44ba688f..44ee6d08d68 100644 --- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c +++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c @@ -183,15 +183,11 @@ glusterd_svc_check_volfile_identical (char *svc_name, need_unlink = 1; - ret = glusterd_create_global_volfile (builder, - tmpvol, NULL); + ret = glusterd_create_global_volfile (builder, tmpvol, NULL); if (ret) goto out; - ret = glusterd_check_files_identical (orgvol, tmpvol, - identical); - if (ret) - goto out; + ret = glusterd_check_files_identical (orgvol, tmpvol, identical); out: if (need_unlink) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b1076c835fd..807b4ecf5e6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -10484,6 +10484,26 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option) conf = this->private; GF_ASSERT (conf); +#ifdef GD_OP_VERSION_3_8_0 + if (conf->op_version >= GD_OP_VERSION_3_8_0) { + /* nfs.disable needs to be enabled for new volumes with + * >= gluster version 3.7 (for now) 3.8 later + */ + if (!option || !strcmp (NFS_DISABLE_MAP_KEY, option)) { + ret = dict_set_dynstr_with_alloc (volinfo->dict, + NFS_DISABLE_MAP_KEY, "on"); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, errno, + GD_MSG_DICT_SET_FAILED, + "Failed to set option '" + NFS_DISABLE_MAP_KEY "' on volume " + "%s", volinfo->volname); + goto out; + } + } + } +#endif + if (conf->op_version >= GD_OP_VERSION_3_7_0) { /* Set needed volume options in volinfo->dict * For ex., diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 50ca60a2e6c..24e99d2be9f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -4953,7 +4953,7 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict) if (voliter->status != GLUSTERD_STATUS_STARTED) continue; - if (dict_get_str_boolean (voliter->dict, "nfs.disable", 0)) + if (dict_get_str_boolean (voliter->dict, NFS_DISABLE_MAP_KEY, 0)) continue; ret = gf_asprintf (&skey, "rpc-auth.addr.%s.allow", diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index a01ef3a74fb..befe618454a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -2577,7 +2577,7 @@ glusterd_op_start_volume (dict_t *dict, char **op_errstr) if (option) { gf_msg_debug (this->name, 0, "NFS-Ganesha is enabled"); /* Gluster-nfs should not start when NFS-Ganesha is enabled*/ - ret = dict_set_str (volinfo->dict, "nfs.disable", "on"); + ret = dict_set_str (volinfo->dict, NFS_DISABLE_MAP_KEY, "on"); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED, "Failed to set nfs.disable for" diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 40323bb7ece..d07a5f07cb4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2146,6 +2146,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { { .key = NFS_DISABLE_MAP_KEY, .voltype = "nfs/server", .option = "!nfs-disable", + .value = "on", .op_version = 1 }, { .key = "nfs.nlm", |