summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-11-02 09:08:42 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-11-11 15:43:35 +0000
commitcefdd02776d204744a13215029f1c3fe024283e4 (patch)
tree19408c5354f310a92ff47035948a8dc4ffae87f9
parent185106a574646bdc2d4ec50756c52db61ad14d98 (diff)
ctime: Enable ctime feature by default
This patch does following. 1. Enable ctime feature by default. 2. Earlier, to enable the ctime feature, two options needed to be enabled a. gluster vol set <volname> utime on b. gluster vol set <volname> ctime on This is inconvenient from the usability point of view. Hence changed it to following single option a. gluster vol set <volname> ctime on fixes: bz#1624724 Change-Id: I04af0e5de1ea6126c58a06ba8a26e22f9f06344e Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r--tests/basic/ctime/ctime-glfs-init.t2
-rw-r--r--tests/basic/ctime/ctime-heal-symlinks.t4
-rw-r--r--tests/basic/ctime/ctime-noatime.t2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c12
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c6
-rw-r--r--xlators/storage/posix/src/posix-common.c2
6 files changed, 7 insertions, 21 deletions
diff --git a/tests/basic/ctime/ctime-glfs-init.t b/tests/basic/ctime/ctime-glfs-init.t
index 0ecd80c2680..56d7d6caee0 100644
--- a/tests/basic/ctime/ctime-glfs-init.t
+++ b/tests/basic/ctime/ctime-glfs-init.t
@@ -9,8 +9,6 @@ TEST glusterd
TEST $CLI volume create $V0 replica 3 ${H0}:$B0/brick{1,2,3};
TEST $CLI volume set $V0 performance.stat-prefetch off
-TEST $CLI volume set $V0 ctime on
-TEST $CLI volume set $V0 utime on
TEST $CLI volume start $V0;
logdir=`gluster --print-logdir`
diff --git a/tests/basic/ctime/ctime-heal-symlinks.t b/tests/basic/ctime/ctime-heal-symlinks.t
index 3922b12546d..547b1807e94 100644
--- a/tests/basic/ctime/ctime-heal-symlinks.t
+++ b/tests/basic/ctime/ctime-heal-symlinks.t
@@ -9,8 +9,6 @@ TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 performance.stat-prefetch off
-TEST $CLI volume set $V0 ctime on
-TEST $CLI volume set $V0 utime on
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
@@ -38,8 +36,6 @@ TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 disperse 3 redundancy 1 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 performance.stat-prefetch off
-TEST $CLI volume set $V0 ctime on
-TEST $CLI volume set $V0 utime on
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
diff --git a/tests/basic/ctime/ctime-noatime.t b/tests/basic/ctime/ctime-noatime.t
index d71528c566c..609ccbd72c1 100644
--- a/tests/basic/ctime/ctime-noatime.t
+++ b/tests/basic/ctime/ctime-noatime.t
@@ -28,8 +28,6 @@ TEST $CLI volume set $V0 performance.open-behind off
TEST $CLI volume set $V0 performance.write-behind off
TEST $CLI volume set $V0 performance.io-cache off
-TEST $CLI volume set $V0 utime on
-TEST $CLI volume set $V0 ctime on
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index b7c658e19fc..4129147daf8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4280,16 +4280,10 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
}
- ret = dict_get_str_boolean(set_dict, "features.utime", _gf_false);
- if (ret == -1)
+ xl = volgen_graph_add(graph, "features/utime", volname);
+ if (!xl) {
+ ret = -1;
goto out;
-
- if (ret) {
- xl = volgen_graph_add(graph, "features/utime", volname);
- if (!xl) {
- ret = -1;
- goto out;
- }
}
/* As of now snapshot volume is read-only. Read-only xlator is loaded
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index ac1e011043d..95ed59e7a62 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -2351,7 +2351,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
},
{
.option = "ctime",
- .key = "storage.ctime",
+ .key = "features.ctime",
.voltype = "storage/posix",
.op_version = GD_OP_VERSION_4_1_0,
},
@@ -2900,10 +2900,10 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.value = "off",
.op_version = GD_OP_VERSION_4_1_0,
.flags = VOLOPT_FLAG_CLIENT_OPT},
- {.key = "features.utime",
+ {.key = "features.ctime",
.voltype = "features/utime",
.validate_fn = validate_boolean,
- .value = "off",
+ .value = "on",
.option = "!utime",
.op_version = GD_OP_VERSION_4_1_0,
.description = "enable/disable utime translator on the volume.",
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index 3642d475cb5..8eef765924a 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -1327,7 +1327,7 @@ struct volume_options options[] = {
"SHA256 checksum. MD5 otherwise."},
{.key = {"ctime"},
.type = GF_OPTION_TYPE_BOOL,
- .default_value = "off",
+ .default_value = "on",
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
.op_version = {GD_OP_VERSION_4_1_0},
.tags = {"ctime"},