From 72a930fd4beada612ca22d1a84177163ae744f67 Mon Sep 17 00:00:00 2001 From: Richard Henwood Date: Wed, 25 Jul 2012 16:07:53 -0400 Subject: [PATCH] LU-1667 ui: fix inaccurate warning message. Trivial fix to make stripe size message accurate. Message is generated if a user issues a 'lfs setstripe' command with a size 4G or larger. The corrected message now reads: "stripe size 4G or larger is not currently supported" Signed-off-by: Richard Henwood Change-Id: I6978e84aee547f40dc20f9b0bfa243d4960e084d Reviewed-on: http://review.whamcloud.com/3464 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Cliff White Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/utils/liblustreapi.c | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index cd75334..11ff8e2 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -226,47 +226,47 @@ int parse_size(char *optarg, unsigned long long *size, /* XXX: llapi_xxx() functions return negative values upon failure */ int llapi_stripe_limit_check(unsigned long long stripe_size, int stripe_offset, - int stripe_count, int stripe_pattern) -{ - int page_size, rc; - - /* 64 KB is the largest common page size I'm aware of (on ia64), but - * check the local page size just in case. */ - page_size = LOV_MIN_STRIPE_SIZE; - if (getpagesize() > page_size) { - page_size = getpagesize(); - llapi_err_noerrno(LLAPI_MSG_WARN, - "warning: your page size (%u) is " - "larger than expected (%u)", page_size, - LOV_MIN_STRIPE_SIZE); - } - if (stripe_size < 0 || (stripe_size & (LOV_MIN_STRIPE_SIZE - 1))) { - rc = -EINVAL; - llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe_size %lu, " - "must be an even multiple of %d bytes", - stripe_size, page_size); - return rc; - } - if (stripe_offset < -1 || stripe_offset > MAX_OBD_DEVICES) { - rc = -EINVAL; - llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe offset %d", - stripe_offset); - return rc; - } - if (stripe_count < -1 || stripe_count > LOV_MAX_STRIPE_COUNT) { - rc = -EINVAL; - llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe count %d", - stripe_count); - return rc; - } - if (stripe_size >= (1ULL << 32)){ - rc = -EINVAL; - llapi_error(LLAPI_MSG_ERROR, rc, - "warning: stripe size larger than 4G " - "is not currently supported and would wrap"); - return rc; - } - return 0; + int stripe_count, int stripe_pattern) +{ + int page_size, rc; + + /* 64 KB is the largest common page size I'm aware of (on ia64), but + * check the local page size just in case. */ + page_size = LOV_MIN_STRIPE_SIZE; + if (getpagesize() > page_size) { + page_size = getpagesize(); + llapi_err_noerrno(LLAPI_MSG_WARN, + "warning: your page size (%u) is " + "larger than expected (%u)", page_size, + LOV_MIN_STRIPE_SIZE); + } + if (stripe_size < 0 || (stripe_size & (LOV_MIN_STRIPE_SIZE - 1))) { + rc = -EINVAL; + llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe_size %lu, " + "must be an even multiple of %d bytes", + stripe_size, page_size); + return rc; + } + if (stripe_offset < -1 || stripe_offset > MAX_OBD_DEVICES) { + rc = -EINVAL; + llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe offset %d", + stripe_offset); + return rc; + } + if (stripe_count < -1 || stripe_count > LOV_MAX_STRIPE_COUNT) { + rc = -EINVAL; + llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe count %d", + stripe_count); + return rc; + } + if (stripe_size >= (1ULL << 32)) { + rc = -EINVAL; + llapi_error(LLAPI_MSG_ERROR, rc, + "warning: stripe size 4G or larger " + "is not currently supported and would wrap"); + return rc; + } + return 0; } /* return the first file matching this pattern */ -- 1.8.3.1