Whamcloud - gitweb
- added dir size it was split on to message about split;
authoryury <yury>
Tue, 31 Oct 2006 18:01:19 +0000 (18:01 +0000)
committeryury <yury>
Tue, 31 Oct 2006 18:01:19 +0000 (18:01 +0000)
- in ll_queue_done_writing() replace assert by check-and-doing nothing if inode is already on close thread queue. Seems it maybe called two times for same inode. If that is not correct Vitaly will fix that later. Tests pass.

lustre/cmm/cmm_split.c
lustre/llite/llite_close.c

index 4d1a67f..6439ac1 100644 (file)
@@ -619,8 +619,9 @@ int cmm_split_try(const struct lu_env *env, struct md_object *mo)
 {
         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)));
@@ -641,6 +642,7 @@ int cmm_split_try(const struct lu_env *env, struct md_object *mo)
                 /* 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;
         }
 
         /*
@@ -683,8 +685,13 @@ int cmm_split_try(const struct lu_env *env, struct md_object *mo)
                 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:
index 2881d90..8a36eda 100644 (file)
@@ -76,11 +76,22 @@ void ll_queue_done_writing(struct inode *inode, unsigned long flags)
 
                 /* 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);
         }