From 9d74f78141b681faf9d60456d00c73d2905f2735 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 9 Apr 2013 13:08:22 +0530 Subject: glusterd: validate performance.nfs.* option values during volume set stage PROBLEM: performance.nfs.* option values (which are of type boolean) are not validated during the stage phase of 'volume set'. The result - nfs graph generation fails during commit phase, AFTER the option and its (invalid) value have been placed in volinfo->dict. CAUSE: nfsperfxl_option_handler() - the function that validates the values of performance.nfs.* options - never receives the (key,value) pair that needs to be set, for validation during 'volume set' stage. FIX: In build_nfs_graph(), copy the (mod_)dict containing the (option,value) parameters into set_dict before attempting to build the client graph for the volume on which the operation is being performed. Of course, an easier way out would be to simply do a 'volume reset' and pretend nothing wrong happened! Change-Id: I56b17d0239d58a9e0b7798933a3c8451e2675b69 BUG: 949930 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/4814 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/bugs/bug-949930.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/bugs/bug-949930.t (limited to 'tests/bugs') diff --git a/tests/bugs/bug-949930.t b/tests/bugs/bug-949930.t new file mode 100644 index 00000000..4a738bef --- /dev/null +++ b/tests/bugs/bug-949930.t @@ -0,0 +1,27 @@ +#!/bin/bash +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +V1=patchy2 + +cleanup; + +TEST glusterd; +TEST pidof glusterd; + +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; +TEST $CLI volume start $V0; + +TEST $CLI volume create $V1 $H0:$B0/${V1}{1,2}; +TEST $CLI volume start $V1; + +TEST ! $CLI volume set $V0 performance.nfs.read-ahead blah +EXPECT '' volume_option $V0 performance.nfs.read-ahead + +TEST $CLI volume set $V0 performance.nfs.read-ahead on +EXPECT "on" volume_option $V0 performance.nfs.read-ahead + +EXPECT '' volume_option $V1 performance.nfs.read-ahead + +cleanup; + -- cgit