From c67aac180b7b1a0fc45060368ec166059a3c8ac0 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Mon, 6 May 2013 10:05:05 +0800 Subject: [PATCH] LU-2193 ofd: check object exists before orphan destroy MDS replay object destroys after recovery could meet non-existing objects, skip it before following futile actions. Signed-off-by: Bobi Jam Change-Id: Ibf233a07fa73d3226fdde5e2c020e73f51428f74 Reviewed-on: http://review.whamcloud.com/6266 Tested-by: Hudson Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Tested-by: Maloo --- lustre/ofd/ofd_obd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/ofd/ofd_obd.c b/lustre/ofd/ofd_obd.c index 059d0e2..7ce79de 100644 --- a/lustre/ofd/ofd_obd.c +++ b/lustre/ofd/ofd_obd.c @@ -1013,6 +1013,8 @@ static int ofd_destroy_by_fid(const struct lu_env *env, fo = ofd_object_find(env, ofd, fid); if (IS_ERR(fo)) RETURN(PTR_ERR(fo)); + if (!ofd_object_exists(fo)) + GOTO(out, rc = -ENOENT); /* Tell the clients that the object is gone now and that they should * throw away any cached pages. */ @@ -1029,7 +1031,8 @@ static int ofd_destroy_by_fid(const struct lu_env *env, LASSERT(fo != NULL); rc = ofd_object_destroy(env, fo, orphan); - + EXIT; +out: ofd_object_put(env, fo); RETURN(rc); } -- 1.8.3.1