All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm-log-writes: invalidate the bdev's for both of our devices
@ 2017-11-28 17:30 Josef Bacik
  2017-11-28 19:29 ` Amir Goldstein
  0 siblings, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2017-11-28 17:30 UTC (permalink / raw)
  To: snitzer, dm-devel, linux-fsdevel; +Cc: Josef Bacik

From: Josef Bacik <jbacik@fb.com>

Amir noticed that sometimes the xfstests using dm-log-writes would fail
randomly but would work fine after trying again manually.  This is
because dm-log-writes writes directly to the device, but the log replay
tools read and write via the block device page cache.  Sometimes this
resulted in stale data being in the block device's page cache which
would result in random failures.  To handle this simply invalidate the
block device page cache on destruction so any replay of the log device
that follows will be forced to read the new real contents.

Reported-and-tested-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 drivers/md/dm-log-writes.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c
index 8b80a9ce9ea9..1c502930af5e 100644
--- a/drivers/md/dm-log-writes.c
+++ b/drivers/md/dm-log-writes.c
@@ -545,6 +545,8 @@ static void log_writes_dtr(struct dm_target *ti)
 		   !atomic_read(&lc->pending_blocks));
 	kthread_stop(lc->log_kthread);
 
+	invalidate_bdev(lc->logdev->bdev);
+	invalidate_bdev(lc->dev->bdev);
 	WARN_ON(!list_empty(&lc->logging_blocks));
 	WARN_ON(!list_empty(&lc->unflushed_blocks));
 	dm_put_device(ti, lc->dev);
-- 
2.7.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-28 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 17:30 [PATCH] dm-log-writes: invalidate the bdev's for both of our devices Josef Bacik
2017-11-28 19:29 ` Amir Goldstein
2017-11-28 20:40   ` Amir Goldstein
2017-11-28 21:05     ` Josef Bacik
2017-11-28 21:22       ` Amir Goldstein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.