Whamcloud - gitweb
LU-2689 interop: use stripe md in ll_update_inode()
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 7 Feb 2013 01:05:08 +0000 (19:05 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 8 Feb 2013 19:03:23 +0000 (14:03 -0500)
When connected to servers that do not support LL_SBI_LAYOUT_LOCK, if
stripe md is available in ll_inode_update() then use it.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I949a0129c3fc92c5434288df0549a54ccd440f97
Reviewed-on: http://review.whamcloud.com/5289
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lclient/lcommon_cl.c
lustre/llite/llite_lib.c

index c9ba748..41ebae9 100644 (file)
@@ -1200,7 +1200,10 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
                         lu_object_ref_add(&clob->co_lu, "inode", inode);
                 } else
                         result = PTR_ERR(clob);
                         lu_object_ref_add(&clob->co_lu, "inode", inode);
                 } else
                         result = PTR_ERR(clob);
-        }
+       } else {
+               result = cl_conf_set(env, lli->lli_clob, &conf);
+       }
+
         cl_env_put(env, &refcheck);
 
         if (result != 0)
         cl_env_put(env, &refcheck);
 
         if (result != 0)
index 0e343f8..6e91365 100644 (file)
@@ -1697,6 +1697,10 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
 
        LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
        if (lsm != NULL) {
 
        LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
        if (lsm != NULL) {
+               if (!lli->lli_has_smd &&
+                   !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
+                       cl_file_inode_init(inode, md);
+
                lli->lli_maxbytes = lsm->lsm_maxbytes;
                if (lli->lli_maxbytes > MAX_LFS_FILESIZE)
                        lli->lli_maxbytes = MAX_LFS_FILESIZE;
                lli->lli_maxbytes = lsm->lsm_maxbytes;
                if (lli->lli_maxbytes > MAX_LFS_FILESIZE)
                        lli->lli_maxbytes = MAX_LFS_FILESIZE;