From a9444bc28f105191bec4ad8fbd540711931eee20 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 18 Oct 2012 16:30:42 +0400 Subject: [PATCH] LU-2138 osp: set expiration before RPC is sent osp_statfs_update() should set opd_statfs_fresh_till before the request is sent. otherwise the race is possible when interpret function is called sooner than osp_statfs_update() sets opd_statfs_fresh_till to "disable" value. the race can result in suspened statfs updates misguiding the object allocation algorithm. Signed-off-by: Alex Zhuravlev Change-Id: I2ff03a611267292d0cd6a465c1eb14023516234b Reviewed-on: http://review.whamcloud.com/4294 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/osp/osp_precreate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index 53cfef9..4ee3ebd 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -148,16 +148,15 @@ static int osp_statfs_update(struct osp_device *d) aa = ptlrpc_req_async_args(req); aa->pointer_arg[0] = d; - ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1); - - cfs_timer_disarm(&d->opd_statfs_timer); - /* * no updates till reply */ + cfs_timer_disarm(&d->opd_statfs_timer); d->opd_statfs_fresh_till = cfs_time_shift(obd_timeout * 1000); d->opd_statfs_update_in_progress = 1; + ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1); + RETURN(0); } -- 1.8.3.1