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 <avati@dev.gluster.com>
This commit is contained in:
Vikas Gorur 2009-02-19 04:26:47 -08:00 committed by Anand V. Avati
parent 1c701badce
commit ed1d91986c

View File

@ -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) {