X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdfilter%2Ffilter.c;h=94c66d602d2b9b7e5daa412e184109c7a7a6473d;hp=1d062b41fd502867805ff6306af52eb1c20bb49b;hb=8c1a09266b8dbb8443ab21c2e5b6a25ed3e3a2e2;hpb=562c1a56135e1d34c1a10ceec52532bc6eab0c3d diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 1d062b4..94c66d6 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1564,7 +1564,7 @@ static int filter_prepare_destroy(struct obd_device *obd, obd_id objid, static void filter_fini_destroy(struct obd_device *obd, struct lustre_handle *lockh) { - if (lockh->cookie) + if (lustre_handle_is_used(lockh)) ldlm_lock_decref(lockh, LCK_PW); } @@ -4089,7 +4089,9 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa, GOTO(cleanup, rc = -ENOENT); } - filter_prepare_destroy(obd, oa->o_id, oa->o_gr, &lockh); + rc = filter_prepare_destroy(obd, oa->o_id, oa->o_gr, &lockh); + if (rc) + GOTO(cleanup, rc); /* Our MDC connection is established by the MDS to us */ if (oa->o_valid & OBD_MD_FLCOOKIE) {