From 13f3654bc7f5acd8df38b66ab8c28397dacf405e Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 29 Apr 2020 12:16:04 +0300 Subject: storage/posix: fix initialization warning reported with clang-10 xlators/storage/posix/src/posix-common.c:1440:18: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] .validate = GF_OPT_VALIDATE_MAX, ^~~~~~~~~~~~~~~~~~~ xlators/storage/posix/src/posix-common.c:1439:18: note: previous initialization is here .validate = GF_OPT_VALIDATE_MIN, ^~~~~~~~~~~~~~~~~~~ [4 times] Use GF_OPT_VALIDATE_BOTH for min/max-bounded values. Fixes: #1208 Change-Id: I073a27d23176f3b4a126f2eb50c079374a11418d Signed-off-by: Dmitry Antipov --- xlators/storage/posix/src/posix-common.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'xlators/storage/posix') diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index da9c653218f..609ddea2560 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -1436,24 +1436,21 @@ struct volume_options posix_options[] = { .min = 0000, .max = 0777, .default_value = "0000", - .validate = GF_OPT_VALIDATE_MIN, - .validate = GF_OPT_VALIDATE_MAX, + .validate = GF_OPT_VALIDATE_BOTH, .description = "Mode bit permission that will always be set on a file."}, {.key = {"force-directory-mode"}, .type = GF_OPTION_TYPE_INT, .min = 0000, .max = 0777, .default_value = "0000", - .validate = GF_OPT_VALIDATE_MIN, - .validate = GF_OPT_VALIDATE_MAX, + .validate = GF_OPT_VALIDATE_BOTH, .description = "Mode bit permission that will be always set on directory"}, {.key = {"create-mask"}, .type = GF_OPTION_TYPE_INT, .min = 0000, .max = 0777, .default_value = "0777", - .validate = GF_OPT_VALIDATE_MIN, - .validate = GF_OPT_VALIDATE_MAX, + .validate = GF_OPT_VALIDATE_BOTH, .description = "Any bit not set here will be removed from the" "modes set on a file when it is created"}, {.key = {"create-directory-mask"}, @@ -1461,8 +1458,7 @@ struct volume_options posix_options[] = { .min = 0000, .max = 0777, .default_value = "0777", - .validate = GF_OPT_VALIDATE_MIN, - .validate = GF_OPT_VALIDATE_MAX, + .validate = GF_OPT_VALIDATE_BOTH, .description = "Any bit not set here will be removed from the" "modes set on a directory when it is created"}, {.key = {"max-hardlinks"}, -- cgit