*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/osd-zfs/osd_object.c
*
GOTO(out, rc = 0);
rc = osd_check_lma(env, obj);
- if ((!rc && !remote) || (rc != -EREMCHG))
+ if (rc != -EREMCHG)
GOTO(out, rc);
+ osd_scrub_refresh_mapping(env, osd, fid, oid, DTO_INDEX_DELETE, true,
+ NULL);
+
trigger:
/* We still have chance to get the valid dnode: for the object that is
* referenced by remote name entry, the object on the local MDT will be
/* It is me to trigger the OI scrub. */
rc1 = osd_scrub_start(env, osd, SS_CLEAR_DRYRUN |
SS_CLEAR_FAILOUT | SS_AUTO_FULL);
- LCONSOLE_WARN("%s: trigger OI scrub by RPC for the "DFID": rc = %d\n",
- osd_name(osd), PFID(fid), rc1);
+ CDEBUG_LIMIT(D_LFSCK | D_CONSOLE | D_WARNING,
+ "%s: trigger OI scrub by RPC for "DFID"/%#llx: rc = %d\n",
+ osd_name(osd), PFID(fid), oid, rc1);
if (!rc) {
LASSERT(remote);
LASSERT(obj->oo_attr.la_size <= osd_sync_destroy_max_size);
rc = -dmu_object_free(osd->od_os, oid, oh->ot_tx);
if (rc)
- CERROR("%s: failed to free %s %llu: rc = %d\n",
+ CERROR("%s: failed to free %s/%#llx: rc = %d\n",
osd->od_svname, buf, oid, rc);
} else if (obj->oo_destroy == OSD_DESTROY_SYNC) {
rc = -dmu_object_free(osd->od_os, oid, oh->ot_tx);
if (rc)
- CERROR("%s: failed to free %s %llu: rc = %d\n",
+ CERROR("%s: failed to free %s/%#llx: rc = %d\n",
osd->od_svname, buf, oid, rc);
} else { /* asynchronous destroy */
char *key = info->oti_key;
rc = osd_zap_add(osd, osd->od_unlinked->dn_object,
osd->od_unlinked, key, 8, 1, &oid, oh->ot_tx);
if (rc)
- CERROR("%s: zap_add_int() failed %s %llu: rc = %d\n",
+ CERROR("%s: zap_add_int() failed %s/%#llx: rc = %d\n",
osd->od_svname, buf, oid, rc);
}
}
read_unlock(&obj->oo_attr_lock);
if (attr->la_valid & LA_FLAGS && attr->la_flags & LUSTRE_ORPHAN_FL)
- CDEBUG(D_INFO, "%s: set orphan flag on "DFID" (%llx/%x)\n",
+ CDEBUG(D_INFO, "%s: set orphan flag on "DFID" (%#llx/%#x)\n",
osd_obj2dev(obj)->od_svname,
PFID(lu_object_fid(&dt->do_lu)),
attr->la_valid, obj->oo_lma_flags);
down_read(&obj->oo_guard);
if (unlikely(!dt_object_exists(dt) || obj->oo_destroyed))
- GOTO(out, rc = 0);
+ GOTO(out_sem, rc = 0);
LASSERT(obj->oo_sa_hdl != NULL);
LASSERT(oh->ot_tx != NULL);
if (!found)
dmu_tx_hold_bonus(oh->ot_tx, obj->oo_dn->dn_object);
if (oh->ot_tx->tx_err != 0)
- GOTO(out, rc = -oh->ot_tx->tx_err);
+ GOTO(out_sem, rc = -oh->ot_tx->tx_err);
if (attr && attr->la_valid & LA_FLAGS) {
/* LMA is usually a part of bonus, no need to declare
osd->od_svname,
attr->la_uid, attr->la_gid, bspace, blksize);
}
+ /* to preserve locking order - qsd_transfer() may need to flush
+ * currently running transaction when we're out of quota. */
+ up_read(&obj->oo_guard);
if (attr && attr->la_valid & LA_UID) {
/* quota enforcement for user */
}
#endif
out:
+ RETURN(rc);
+out_sem:
up_read(&obj->oo_guard);
RETURN(rc);
}