Whamcloud - gitweb
LU-2793 fld: send special seq lookup request to MDT0
[fs/lustre-release.git] / lustre / osd-zfs / osd_object.c
index a619f2c..ac6b52d 100644 (file)
@@ -28,7 +28,7 @@
  * Use is subject to license terms.
  */
 /*
- * Copyright (c) 2011, 2012 Whamcloud, Inc.
+ * Copyright (c) 2012, Intel Corporation.
  * Use is subject to license terms.
  */
 /*
@@ -364,6 +364,12 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l,
 
        LASSERT(osd_invariant(obj));
 
+       if (fid_is_otable_it(&l->lo_header->loh_fid)) {
+               obj->oo_dt.do_ops = &osd_obj_otable_it_ops;
+               l->lo_header->loh_attr |= LOHA_EXISTS;
+               RETURN(0);
+       }
+
        rc = osd_fid_lookup(env, osd, lu_object_fid(l), &oid);
        if (rc == 0) {
                LASSERT(obj->oo_db == NULL);
@@ -377,11 +383,6 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l,
                               osd->od_svname, PFID(lu_object_fid(l)), oid, rc);
                }
        } else if (rc == -ENOENT) {
-               if (fid_is_otable_it(&l->lo_header->loh_fid)) {
-                       obj->oo_dt.do_ops = &osd_obj_otable_it_ops;
-                       /* LFSCK iterator object is special without inode */
-                       l->lo_header->loh_attr |= LOHA_EXISTS;
-                }
                rc = 0;
        }
        LASSERT(osd_invariant(obj));
@@ -782,8 +783,9 @@ static inline int qsd_transfer(const struct lu_env *env,
        /* and one less inode for the current id */
        qi->lqi_id.qid_uid = orig_id;;
        qi->lqi_space      = -1;
+       /* can't get EDQUOT when reducing usage */
        rc = qsd_op_begin(env, qsd, trans, qi, NULL);
-       if (rc == -EDQUOT || rc == -EINPROGRESS)
+       if (rc == -EINPROGRESS)
                rc = 0;
        if (rc)
                return rc;
@@ -804,7 +806,8 @@ static inline int qsd_transfer(const struct lu_env *env,
        qi->lqi_id.qid_uid = orig_id;
        qi->lqi_space      = -bspace;
        rc = qsd_op_begin(env, qsd, trans, qi, NULL);
-       if (rc == -EDQUOT || rc == -EINPROGRESS)
+       /* can't get EDQUOT when reducing usage */
+       if (rc == -EINPROGRESS)
                rc = 0;
        return rc;
 }
@@ -1037,6 +1040,7 @@ static int osd_declare_object_create(const struct lu_env *env,
        struct osd_device       *osd = osd_obj2dev(obj);
        struct osd_thandle      *oh;
        uint64_t                 zapid;
+       int                      rc;
        ENTRY;
 
        LASSERT(dof);
@@ -1090,8 +1094,9 @@ static int osd_declare_object_create(const struct lu_env *env,
        __osd_xattr_declare_set(env, obj, sizeof(struct lustre_mdt_attrs),
                                XATTR_NAME_LMA, oh);
 
-       RETURN(osd_declare_quota(env, osd, attr->la_uid, attr->la_gid, 1, oh,
-                                false, NULL, false));
+       rc = osd_declare_quota(env, osd, attr->la_uid, attr->la_gid, 1, oh,
+                              false, NULL, false);
+       RETURN(rc);
 }
 
 int __osd_attr_init(const struct lu_env *env, udmu_objset_t *uos,