Whamcloud - gitweb
b=17485 Don't reset the lov_objid to last_id sent by OST
authorVladimir Saveliev <Vladimir.Saveliev@sun.com>
Fri, 20 Aug 2010 15:03:09 +0000 (19:03 +0400)
committerMikhail Pershin <tappro@sun.com>
Sat, 21 Aug 2010 10:05:28 +0000 (14:05 +0400)
https://bugzilla.lustre.org/attachment.cgi?id=30559 for head

i=Hongchao.zhang
i=andrew.perepechko

lustre/mds/mds_lov.c
lustre/obdfilter/filter.c
lustre/osc/osc_create.c

index a44652a..0bf8a72 100644 (file)
@@ -482,7 +482,6 @@ static int mds_lov_get_objid(struct obd_device * obd,
         unsigned int page;
         unsigned int off;
         obd_id *data;
-        __u64 connect_flags;
         __u32 size;
         int rc = 0;
         ENTRY;
@@ -491,14 +490,7 @@ static int mds_lov_get_objid(struct obd_device * obd,
         off = idx % OBJID_PER_PAGE();
         data = mds->mds_lov_page_array[page];
 
-        size = sizeof(__u64);
-        connect_flags = idx;
-        rc = obd_get_info(lov_exp, sizeof(KEY_CONNECT_FLAG), KEY_CONNECT_FLAG,
-                          &size, &connect_flags, NULL);
-        if (rc)
-                GOTO(out, rc);
-
-        if (data[off] < 2 || connect_flags & OBD_CONNECT_SKIP_ORPHAN) {
+        if (data[off] < 2) {
                 /* We never read this lastid; ask the osc */
                 struct obd_id_info lastid;
 
index 69e06be..1c485bb 100644 (file)
@@ -3541,7 +3541,14 @@ static int filter_destroy_precreated(struct obd_export *exp, struct obdo *oa,
                 filter_set_last_id(filter, id, doa.o_seq);
                 rc = filter_update_last_objid(exp->exp_obd, doa.o_seq, 1);
         } else {
-                /* don't reuse orphan object, return last used objid */
+                /*
+                 * We have destroyed orphan objects, but don't want to reuse
+                 * them. Therefore we don't reset last_id to the last created
+                 * objects. Instead, we report back to the MDS the object id
+                 * of the last orphan, so that the MDS can restart allocating
+                 * objects from this id + 1 and thus skip the whole orphan
+                 * object id range
+                 */
                 oa->o_id = last;
                 rc = 0;
         }
index 6dfd1e4..815b15b 100644 (file)
@@ -579,6 +579,11 @@ int osc_create(struct obd_export *exp, struct obdo *oa,
                         oscc->oscc_last_id = oa->o_id;
                         ocd = &imp->imp_connect_data;
                         if (ocd->ocd_connect_flags & OBD_CONNECT_SKIP_ORPHAN) {
+                                /*
+                                 * The OST reports back in oa->o_id from where
+                                 * we should restart in order to skip orphan
+                                 * objects
+                                 */
                                 CDEBUG(D_HA, "%s: Skip orphan set, reset last "
                                        "objid\n", oscc->oscc_obd->obd_name);
                                 oscc->oscc_next_id = oa->o_id + 1;