{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
struct md_attr *ma = &cmm_env_info(env)->cmi_ma;
+ int rc = 0, split;
+ __u64 la_size = 0;
struct lu_buf *buf;
- int rc = 0, split;
ENTRY;
LASSERT(S_ISDIR(lu_object_attr(&mo->mo_lu)));
/* Split should be done now, let's do it. */
CWARN("Dir "DFID" is going to split\n",
PFID(lu_object_fid(&mo->mo_lu)));
+ la_size = ma->ma_attr.la_size;
}
/*
GOTO(cleanup, rc);
}
- /* Finally, split succeed, tell client to recreate the object */
- CWARN("Dir "DFID" has been split\n", PFID(lu_object_fid(&mo->mo_lu)));
+ /*
+ * Finally, split succeed, tell client to repeat opetartion on correct
+ * MDT.
+ */
+ CWARN("Dir "DFID" has been split (on size: "LPU64")\n",
+ PFID(lu_object_fid(&mo->mo_lu)), la_size);
+
rc = -ERESTART;
EXIT;
cleanup:
/* DONE_WRITING is allowed and inode has no dirty page. */
spin_lock(&lcq->lcq_lock);
- LASSERT(list_empty(&lli->lli_close_list));
- CDEBUG(D_INODE, "adding inode %lu/%u to close list\n",
- inode->i_ino, inode->i_generation);
-
- list_add_tail(&lli->lli_close_list, &lcq->lcq_head);
+
+ /*
+ * XXX: Seems sometimes it is possible to try to add inode more
+ * than once to close thread queue. Not sure if that is correct
+ * from caller POV, but it looks to me logically to check this
+ * here and just do nothing if inode is already on the queue.
+ * Hope Vitaly will correct me if I'm wrong. --umka
+ */
+ if (list_empty(&lli->lli_close_list)) {
+ CDEBUG(D_INODE, "adding inode %lu/%u to close list\n",
+ inode->i_ino, inode->i_generation);
+ list_add_tail(&lli->lli_close_list, &lcq->lcq_head);
+ } else {
+ CWARN("Inode %d is already queued for done writing!\n",
+ inode->i_ino);
+ }
wake_up(&lcq->lcq_waitq);
spin_unlock(&lcq->lcq_lock);
}