Whamcloud - gitweb
LU-15082 osp: invalidate statfs data from the timer callback
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 12 Oct 2021 05:26:21 +0000 (08:26 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 21 Jan 2023 02:52:28 +0000 (02:52 +0000)
osp_statfs_timer_cb() can be called just before statfs data gets
stale. this in turn may cause early wakeup to the precreate thread
which would find statfs data still up-to-data and go back to slepp.
if no precreate happens to this OSP (e.g. due to current space
usage), then the precreate thread will stay asleep for a long time,
statfs data won't get refreshed and this may block new objects
on the corresponding OST.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I86e16eed6f1068702db696a9ddec7a22994180b7
Reviewed-on: https://review.whamcloud.com/45199
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49694

lustre/osp/osp_precreate.c

index a4e1507..5c764f3 100644 (file)
@@ -82,6 +82,8 @@ static void osp_statfs_timer_cb(cfs_timer_cb_arg_t data)
        struct osp_device *d = cfs_from_timer(d, data, opd_statfs_timer);
 
        LASSERT(d);
+       /* invalidate statfs data so osp_precreate_thread() can refresh */
+       d->opd_statfs_fresh_till = ktime_sub_ns(ktime_get(), NSEC_PER_SEC);
        if (d->opd_pre_task)
                wake_up(&d->opd_pre_waitq);
 }