@@ -287,7 +287,7 @@ struct cl_layout {
/** size of layout in lov_mds_md format. */
size_t cl_size;
/** size of DoM component if exists or zero otherwise */
- u32 cl_dom_comp_size;
+ u64 cl_dom_comp_size;
/** Layout generation. */
u32 cl_layout_gen;
/** whether layout is a composite one */
@@ -197,10 +197,9 @@ int ll_dom_lock_cancel(struct inode *inode, struct ldlm_lock *lock)
CDEBUG(D_INODE, "Cannot get layout for "DFID"\n",
PFID(ll_inode2fid(inode)));
rc = -ENODATA;
- } else if (clt.cl_dom_comp_size == 0) {
+ } else if (clt.cl_size == 0 || clt.cl_dom_comp_size == 0) {
CDEBUG(D_INODE, "DOM lock without DOM layout for "DFID"\n",
PFID(ll_inode2fid(inode)));
- rc = -EINVAL;
} else {
enum cl_fsync_mode mode;
loff_t end = clt.cl_dom_comp_size - 1;
@@ -1869,6 +1869,7 @@ static int lov_object_layout_get(const struct lu_env *env,
cl->cl_size = lov_comp_md_size(lsm);
cl->cl_layout_gen = lsm->lsm_layout_gen;
+ cl->cl_dom_comp_size = 0;
if (lsm_is_composite(lsm->lsm_magic)) {
struct lov_stripe_md_entry *lsme = lsm->lsm_entries[0];
@@ -1876,7 +1877,10 @@ static int lov_object_layout_get(const struct lu_env *env,
if (lsme_is_dom(lsme))
cl->cl_dom_comp_size = lsme->lsme_extent.e_end;
+ } else {
+ cl->cl_is_composite = false;
}
+
rc = lov_lsm_pack(lsm, buf->lb_buf, buf->lb_len);
lov_lsm_put(lsm);