Whamcloud - gitweb
Don't assert bitmap exists - it won't for error-during-setup self-export destroy
[fs/lustre-release.git] / lustre / mds / mds_fs.c
index d3e235a..7979092 100644 (file)
@@ -127,7 +127,6 @@ int mds_client_free(struct obd_export *exp, int clear_client)
         int rc;
         unsigned long *bitmap = mds->mds_client_bitmap;
 
-        LASSERT(bitmap);
         if (!med->med_mcd)
                 RETURN(0);
 
@@ -138,6 +137,7 @@ int mds_client_free(struct obd_export *exp, int clear_client)
         CDEBUG(D_INFO, "freeing client at idx %u (%lld)with UUID '%s'\n",
                med->med_idx, med->med_off, med->med_mcd->mcd_uuid);
 
+        LASSERT(bitmap);
         /* Clear the bit _after_ zeroing out the client so we don't
            race with mds_client_add and zero out new clients.*/
         if (!test_bit(med->med_idx, bitmap)) {
@@ -370,10 +370,9 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt)
         int rc;
         ENTRY;
 
-
-        /* Get rid of unneeded supplementary groups */
-        current->ngroups = 0;
-        memset(current->groups, 0, sizeof(current->groups));
+        rc = cleanup_group_info();
+        if (rc)
+                RETURN(rc);
 
         mds->mds_vfsmnt = mnt;
         mds->mds_sb = mnt->mnt_root->d_inode->i_sb;
@@ -643,7 +642,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         de = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
         if (de == NULL || de->d_inode == NULL) {
                 CERROR("destroying non-existent object "LPU64"\n", oa->o_id);
-                GOTO(out, rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT);
+                GOTO(out_dput, rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT);
         }
 
         handle = fsfilt_start(obd, mds->mds_objects_dir->d_inode,
@@ -661,8 +660,8 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         if (err && !rc)
                 rc = err;
 out_dput:
-        l_dput(de);
-out:
+        if (de != NULL)
+                l_dput(de);
         up(&parent_inode->i_sem);
         pop_ctxt(&saved, &obd->obd_ctxt, NULL);
         RETURN(rc);