summaryrefslogtreecommitdiff
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorPankaj Gupta <pankaj.gupta@cloud.ionos.com>2020-11-11 06:16:58 +0100
committerSong Liu <songliubraving@fb.com>2020-11-30 10:12:35 -0800
commita23f2aae8498d8c8bb6ff5301bda02db8093cb09 (patch)
tree77978801460450f726e0bf454474d653c8a330f3 /drivers/md/md.c
parent204d1a6434158ac655fc4037f29742b9b6103f0e (diff)
md: use current request time as base for ktime comparisons
Request coalescing logic uses 'prev_flush_start' as base to compare the current request start time. 'prev_flush_start' is updated in other context. This patch changes this by using ktime comparison base to 'req_start' for better readability of code. Signed-off-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a0998ad6388c..1a3a6150123e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -667,10 +667,10 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
*/
wait_event_lock_irq(mddev->sb_wait,
!mddev->flush_bio ||
- ktime_after(mddev->prev_flush_start, req_start),
+ ktime_before(req_start, mddev->prev_flush_start),
mddev->lock);
/* new request after previous flush is completed */
- if (!ktime_after(mddev->prev_flush_start, req_start)) {
+ if (ktime_after(req_start, mddev->prev_flush_start)) {
WARN_ON(mddev->flush_bio);
mddev->flush_bio = bio;
bio = NULL;