From: Etienne AUJAMES Date: Fri, 31 Jul 2020 18:29:43 +0000 (+0200) Subject: LU-13845 utils: Quota id 0xFFFFFFFF is invalid X-Git-Tag: 2.13.57~142 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7b5c1f1404c32a922915742287371f2d137c6392;p=fs%2Flustre-release.git LU-13845 utils: Quota id 0xFFFFFFFF is invalid "lfs setquota" and "lfs quota" should consider as invalid quota id value 0xFFFFFFFF (aka. (uid_t)-1) Fixes: 3d9900e78e ("LU-12549 utils: Check range of quota ID for lfs") Signed-off-by: Etienne AUJAMES Change-Id: Idbd5970a6f53a544c15bdf22bcf24a7aeba772a8 Reviewed-on: https://review.whamcloud.com/39559 Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 99539b2..d2046d7 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -4212,8 +4212,7 @@ static int str2quotaid(__u32 *id, const char *arg) projid_tmp = strtoul(arg, &endptr, 10); if (*endptr != '\0') return -EINVAL; - if (projid_tmp > UINT32_MAX || - (projid_tmp == ULONG_MAX && (errno == ERANGE))) + if (projid_tmp >= UINT32_MAX) return -ERANGE; *id = projid_tmp;