struct ll_inode_info *lli = ll_i2info(inode);
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *req = NULL;
- struct mdt_body *body;
void *xdata;
int rc;
ENTRY;
if (rc < 0)
GOTO(out_xattr, rc);
- body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
- LASSERT(body);
-
/* only detect the xattr size */
if (size == 0)
- GOTO(out, rc = body->mbo_eadatasize);
+ GOTO(out, rc);
- if (size < body->mbo_eadatasize) {
- CERROR("server bug: replied size %u > %u\n",
- body->mbo_eadatasize, (int)size);
+ if (size < rc)
GOTO(out, rc = -ERANGE);
- }
-
- if (body->mbo_eadatasize == 0)
- GOTO(out, rc = -ENODATA);
/* do not need swab xattr data */
xdata = req_capsule_server_sized_get(&req->rq_pill, &RMF_EADATA,
- body->mbo_eadatasize);
+ rc);
if (!xdata)
- GOTO(out, rc = -EFAULT);
+ GOTO(out, rc = -EPROTO);
- memcpy(buffer, xdata, body->mbo_eadatasize);
- rc = body->mbo_eadatasize;
+ memcpy(buffer, xdata, rc);
}
EXIT;
out_xattr:
if (rc == -EOPNOTSUPP && type == XATTR_USER_T) {
LCONSOLE_INFO("%s: disabling user_xattr feature because "
- "it is not supported on the server: rc = %d\n",
- ll_get_fsname(inode->i_sb, NULL, 0), rc);
+ "it is not supported on the server: rc = %d\n",
+ sbi->ll_fsname, rc);
sbi->ll_flags &= ~LL_SBI_USER_XATTR;
}
out: