Whamcloud - gitweb
LU-12043 llite: switch to use ll_fsname directly
[fs/lustre-release.git] / lustre / llite / xattr.c
index ac1dd91..3958dd6 100644 (file)
@@ -343,7 +343,6 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer,
        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;
@@ -375,30 +374,20 @@ getxattr_nocache:
                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;
@@ -406,8 +395,8 @@ getxattr_nocache:
 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: