From 418b33680481dce3d5102673b4129bf9ed03a403 Mon Sep 17 00:00:00 2001 From: Dmitry Zogin Date: Thu, 30 Sep 2010 09:09:40 -0400 Subject: [PATCH] b=20146 Metadata performance degradation from 1.6.5 vs 1.8.0.190 Don't update ctime if we are really removing the inode. i=mikhail.pershin i=andreas.dilger --- lustre/mdd/mdd_dir.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index 2ee1985..098b5d4 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -884,10 +884,14 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj, if (rc) GOTO(cleanup, rc); - la->la_valid = LA_CTIME; - rc = mdd_attr_check_set_internal(env, mdd_cobj, la, handle, 0); - if (rc) - GOTO(cleanup, rc); + if (ma->ma_attr.la_nlink > 0 || mdd_cobj->mod_count > 0) { + /* update ctime of an unlinked file only if it is still + * opened or a link still exists */ + la->la_valid = LA_CTIME; + rc = mdd_attr_check_set_internal(env, mdd_cobj, la, handle, 0); + if (rc) + GOTO(cleanup, rc); + } rc = mdd_finish_unlink(env, mdd_cobj, ma, handle); #ifdef HAVE_QUOTA_SUPPORT -- 1.8.3.1