diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2021-01-22 12:55:08 +0300 |
---|---|---|
committer | Xavi Hernandez <xhernandez@users.noreply.github.com> | 2021-01-22 23:38:46 +0100 |
commit | 1d90a30ab5caad4c631d8c9b9dd0f487bd343ad1 (patch) | |
tree | 1dda8fb0ecfaf6bee9033d72f421ee3badf9c17e /xlators | |
parent | de19b9a00ea35cf01076c9eb48067ad8a2e1c4aa (diff) | |
download | glusterfs-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.c | 29 |
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 |