Whamcloud - gitweb
Merge branch 'master' of git.lustre.org:prime/lustre
[fs/lustre-release.git] / lustre / mdd / mdd_lov.c
index 1b0336a..1e16f38 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -145,7 +145,9 @@ int mdd_init_obd(const struct lu_env *env, struct mdd_device *mdd,
                 LBUG();
         }
 
+        cfs_spin_lock(&obd->obd_dev_lock);
         obd->obd_recovering = 1;
+        cfs_spin_unlock(&obd->obd_dev_lock);
         obd->u.mds.mds_id = mds_id;
         rc = class_setup(obd, lcfg);
         if (rc)
@@ -274,8 +276,8 @@ static int mdd_lov_set_dir_md(const struct lu_env *env,
 
         /* if { size, offset, count } = { 0, -1, 0 } and no pool (i.e. all default
          * values specified) then delete default striping from dir. */
-        if (lum->lmm_stripe_size == 0 && lum->lmm_stripe_count == 0 &&
-            lum->lmm_stripe_offset == (typeof(lum->lmm_stripe_offset))(-1) &&
+        if (LOVEA_DELETE_VALUES(lum->lmm_stripe_size, lum->lmm_stripe_count,
+                                lum->lmm_stripe_offset) &&
             lum->lmm_magic != LOV_USER_MAGIC_V3) {
                 rc = mdd_xattr_set_txn(env, obj, &LU_BUF_NULL,
                                        XATTR_NAME_LOV, 0, handle);