Whamcloud - gitweb
LU-4008 mdt: update mdt_getattr comments about EA sizing 41/10141/2
authorOleg Drokin <oleg.drokin@intel.com>
Tue, 29 Apr 2014 00:57:53 +0000 (20:57 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 30 Apr 2014 17:51:41 +0000 (17:51 +0000)
After landing previous patches, some comments became out of date
This patch tries to rectify the situation and also adds some
additional explanations.

Change-Id: Ic3fb33ec60f7ae083ecae84cd207d2c10b95f965
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10141
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
lustre/mdt/mdt_handler.c

index 66c60ee..ccbf2a9 100644 (file)
@@ -1078,6 +1078,10 @@ static int mdt_getattr(struct tgt_session_info *tsi)
         LASSERT(obj != NULL);
        LASSERT(lu_object_assert_exists(&obj->mot_obj));
 
+       /* Unlike intent case where we need to pre-fill out buffers early on
+        * in intent policy for ldlm reasons, here we can have a much better
+        * guess at EA size by just reading it from disk.
+        * Exceptions are readdir and (missing) directory striping */
        /* Readlink */
        if (reqbody->valid & OBD_MD_LINKNAME) {
                /* No easy way to know how long is the symlink, but it cannot
@@ -1096,15 +1100,13 @@ static int mdt_getattr(struct tgt_session_info *tsi)
                 * will reallocate */
                rc = DEF_REP_MD_SIZE;
        } else {
-               /* Hopefully no race in EA change for either file or directory?
-                */
+               /* Read the actual EA size from disk */
                rc = mdt_attr_get_eabuf_size(info, obj);
        }
 
        if (rc < 0)
                GOTO(out_shrink, rc);
 
-       /* old clients may not report needed easize, use max value then */
        req_capsule_set_size(pill, &RMF_MDT_MD, RCL_SERVER, rc);
 
        rc = req_capsule_server_pack(pill);