From ed1d91986cdaf0240b4e6a8c920f17b7f2d6d57b Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 19 Feb 2009 04:26:47 -0800 Subject: warn on ERANGE error for lgetxattr in posix (amended to fit in 80 columns) ERANGE is usually caused by the user reducing the number of AFR's children but continues to use the old backend. Signed-off-by: Anand V. Avati --- xlators/storage/posix/src/xattr-cache.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/xattr-cache.c b/xlators/storage/posix/src/xattr-cache.c index a39c35ae234..0af4e353625 100644 --- a/xlators/storage/posix/src/xattr-cache.c +++ b/xlators/storage/posix/src/xattr-cache.c @@ -40,6 +40,24 @@ __hgetxattr (xattr_cache_handle_t *handle, xlator_t *this, if (op_ret == -1) op_ret = -errno; + + if (errno == ERANGE) { + /* + * xattr array is bigger than expected. + * This usually happens when user reduces + * the number of AFR's children but continues + * to use the old backend. + */ + + gf_log (this->name, GF_LOG_WARNING, + "%s: Have you reduced the number of " + "cluster/replicate's children but are " + "continuing to use the same backend? " + "Please populate the backend freshly " + "when doing such a migration.", + strerror (errno)); + } + } else { ret = fd_ctx_get (handle->fd, this, &tmp_pfd); if (ret < 0) { -- cgit