From d42ad247ce3f5be79cd6a13de95bca146a16ccd0 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 24 Feb 2005 23:53:56 +0000 Subject: [PATCH] Branch: b1_4 Allow mtime/atime to be set backward. b=4829, b=5669 --- lustre/obdfilter/filter.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 1f1f477..acbb5f2 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1714,20 +1714,17 @@ static int filter_setattr(struct obd_export *exp, struct obdo *oa, rc = rc2; } - if (iattr.ia_valid & ATTR_SIZE) { - res = ldlm_resource_get(exp->exp_obd->obd_namespace, NULL, - res_id, LDLM_EXTENT, 0); - if (res == NULL) { - CERROR("!!! resource_get failed for object "LPU64" -- " - "filter_setattr with no lock?\n", oa->o_id); - } else { - if (res->lr_namespace->ns_lvbo && - res->lr_namespace->ns_lvbo->lvbo_update) { - rc = res->lr_namespace->ns_lvbo->lvbo_update - (res, NULL, 0, 0); - } - ldlm_resource_putref(res); - } + res = ldlm_resource_get(exp->exp_obd->obd_namespace, NULL, + res_id, LDLM_EXTENT, 0); + if (res != NULL) { + if (res->lr_namespace->ns_lvbo && + res->lr_namespace->ns_lvbo->lvbo_update) + rc = res->lr_namespace->ns_lvbo->lvbo_update(res, NULL, + 0, 0); + ldlm_resource_putref(res); + } else if (iattr.ia_valid & ATTR_SIZE) { + CERROR("!!! resource_get failed for object "LPU64" -- " + "filter_setattr with no lock?\n", oa->o_id); } oa->o_valid = OBD_MD_FLID; -- 1.8.3.1