Whamcloud - gitweb
LU-2138 osp: set expiration before RPC is sent
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Thu, 18 Oct 2012 12:30:42 +0000 (16:30 +0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 Oct 2012 14:55:15 +0000 (10:55 -0400)
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 <alexey.zhuravlev@intel.com>
Change-Id: I2ff03a611267292d0cd6a465c1eb14023516234b
Reviewed-on: http://review.whamcloud.com/4294
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_precreate.c

index 53cfef9..4ee3ebd 100644 (file)
@@ -148,16 +148,15 @@ static int osp_statfs_update(struct osp_device *d)
        aa = ptlrpc_req_async_args(req);
        aa->pointer_arg[0] = 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
         */
        /*
         * 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;
 
        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);
 }
 
        RETURN(0);
 }