If the MDS is replaying object destroys after recovery, then it may
be trying to destroy non-existent objects. This can provoke spurious
errors in lvbo_init() due to the inability to populate the lock LVB.
Rather than quiet the useful error message from lvbo_init(), instead
do the object lookup on the to-be-destroyed FID first. If lookup
fails to find an object, skip the object locking entirely since it
isn't needed and would just flood the console after recovery.
During destroy RPCs from the MDS, the ELC buffer is always empty, so
short-circuit the initial lock cancellation attempt that is useless.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Id6197f23773ea271e0cb0912b19585b3df500c1e
Reviewed-on: http://review.whamcloud.com/4276
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (first >= count)
RETURN(0);
if (first >= count)
RETURN(0);
+ if (count == 1 && dlm_req->lock_handle[0].cookie == 0)
+ RETURN(0);
+
/* There is no lock on the server at the replay time,
* skip lock cancelling to make replay tests to pass. */
if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
/* There is no lock on the server at the replay time,
* skip lock cancelling to make replay tests to pass. */
if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
+ fo = ofd_object_find(env, ofd, fid);
+ if (IS_ERR(fo))
+ RETURN(PTR_ERR(fo));
+
/* Tell the clients that the object is gone now and that they should
* throw away any cached pages. */
ofd_build_resid(fid, &info->fti_resid);
/* Tell the clients that the object is gone now and that they should
* throw away any cached pages. */
ofd_build_resid(fid, &info->fti_resid);
if (rc == ELDLM_OK)
ldlm_lock_decref(&lockh, LCK_PW);
if (rc == ELDLM_OK)
ldlm_lock_decref(&lockh, LCK_PW);
- fo = ofd_object_find(env, ofd, fid);
- if (IS_ERR(fo))
- RETURN(PTR_ERR(fo));
LASSERT(fo != NULL);
rc = ofd_object_destroy(env, fo, orphan);
LASSERT(fo != NULL);
rc = ofd_object_destroy(env, fo, orphan);
lrc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 0);
if (lrc == -ENOENT) {
CDEBUG(D_INODE,
lrc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 0);
if (lrc == -ENOENT) {
CDEBUG(D_INODE,
- "destroying non-existent object "LPU64"\n",
- oa->o_id);
+ "%s: destroying non-existent object "DFID"\n",
+ ofd_obd(ofd)->obd_name, PFID(&info->fti_fid));
/* rewrite rc with -ENOENT only if it is 0 */
if (rc == 0)
rc = lrc;
} else if (lrc != 0) {
/* rewrite rc with -ENOENT only if it is 0 */
if (rc == 0)
rc = lrc;
} else if (lrc != 0) {
- CEMERG("error destroying object "LPU64": %d\n",
- oa->o_id, rc);
+ CERROR("%s: error destroying object "DFID": %d\n",
+ ofd_obd(ofd)->obd_name, PFID(&info->fti_fid),
+ rc);