summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2021-01-22 12:55:08 +0300
committerXavi Hernandez <xhernandez@users.noreply.github.com>2021-01-22 23:38:46 +0100
commit1d90a30ab5caad4c631d8c9b9dd0f487bd343ad1 (patch)
tree1dda8fb0ecfaf6bee9033d72f421ee3badf9c17e /xlators
parentde19b9a00ea35cf01076c9eb48067ad8a2e1c4aa (diff)
downloadglusterfs-1d90a30ab5caad4c631d8c9b9dd0f487bd343ad1.tar.gz
glusterfs-1d90a30ab5caad4c631d8c9b9dd0f487bd343ad1.tar.xz
glusterfs-1d90a30ab5caad4c631d8c9b9dd0f487bd343ad1.zip
glusterd: do not allow changing storage.linux-aio for running volume
Do not allow changing storage.linux-aio for running volume, cleanup nearby storage.linux-io_uring error message as well. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #2039
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index b6a73c9f8e..bbf173327d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1196,24 +1196,33 @@ glusterd_op_stage_set_volume(dict_t *dict, char **op_errstr)
key = key_fixed;
keylen = strlen(key_fixed);
}
-#ifdef HAVE_LIBURING
- if (len_strcmp(key, keylen, "storage.linux-io_uring")) {
- if (volinfo == NULL) {
- snprintf(errstr, sizeof(errstr), "vol info is NULL for %s.",
- volname);
+
+#ifdef HAVE_LIBAIO
+ if (len_strcmp(key, keylen, "storage.linux-aio")) {
+ if (volinfo && volinfo->status == GLUSTERD_STATUS_STARTED) {
+ snprintf(errstr, sizeof(errstr),
+ "Changing 'storage.linux-aio' is not"
+ " supported when the volume is in started"
+ " state. Please stop the volume first.");
ret = -1;
goto out;
}
- if (volinfo->status == GLUSTERD_STATUS_STARTED) {
+ }
+#endif /* HAVE_LIBAIO */
+
+#ifdef HAVE_LIBURING
+ if (len_strcmp(key, keylen, "storage.linux-io_uring")) {
+ if (volinfo && volinfo->status == GLUSTERD_STATUS_STARTED) {
snprintf(errstr, sizeof(errstr),
- "Changing this option is "
- "not supported when volume is in started state. "
- "Please stop the volume.");
+ "Changing 'storage.linux-io_uring' is not"
+ " supported when the volume is in started"
+ " state. Please stop the volume first.");
ret = -1;
goto out;
}
}
-#endif
+#endif /* HAVE_LIBURING */
+
if (len_strcmp(key, keylen, "cluster.granular-entry-heal")) {
/* For granular entry-heal, if the set command was
* invoked through volume-set CLI, then allow the