Whamcloud - gitweb
LU-2823 obdfilter: always return last id when del orphan
authorNiu Yawei <niu@whamcloud.com>
Sun, 17 Feb 2013 03:32:54 +0000 (22:32 -0500)
committerJohann Lombardi <johann.lombardi@intel.com>
Mon, 8 Apr 2013 08:40:27 +0000 (04:40 -0400)
In filter_destroy_precreated(), it should still return the last id
even if the fo_destroy_in_progress was cleared already, otherwise
the last_id on MDS will not be synced with the last_id on obdfilter.

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes \
clientdistro=el6 serverdistro=el5 \
clientarch=x86_64 serverarch=x86_64 \
nettypes=o2ib clientibstack=inkernel \
serveribstack=inkernel testlist=large-scale

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I01a5a5da201e227c139c3406adcaa896e5d5b71f
Reviewed-on: http://review.whamcloud.com/5448
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/obdfilter/filter.c

index 661bf47..9f4f7b5 100644 (file)
@@ -3115,12 +3115,6 @@ static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
         }
         doa.o_mode = S_IFREG;
 
-        if (!filter->fo_destroy_in_progress) {
-                CERROR("%s: destroy_in_progress already cleared\n",
-                        exp->exp_obd->obd_name);
-                RETURN(0);
-        }
-
         last = filter_last_id(filter, doa.o_gr);
         skip_orphan = !!(exp->exp_connect_flags & OBD_CONNECT_SKIP_ORPHAN);
 
@@ -3128,6 +3122,14 @@ static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
                exp->exp_obd->obd_name, oa->o_id + 1, last,
                skip_orphan ? ", orphan objids won't be reused any more." : ".");
 
+        if (!filter->fo_destroy_in_progress) {
+                CWARN("%s: destroy_in_progress already cleared to "LPU64"\n",
+                      exp->exp_obd->obd_name, last);
+                if (skip_orphan)
+                        oa->o_id = last;
+                RETURN(0);
+        }
+
         for (id = last; id > oa->o_id; id--) {
                 doa.o_id = id;
                 rc = filter_destroy(exp, &doa, NULL, NULL, NULL);