* [PATCH] dm flakey: add DAX support
@ 2016-09-20 20:47 Dave Jiang
2016-09-20 21:42 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2016-09-20 20:47 UTC (permalink / raw)
To: snitzer, agk
Cc: dm-devel, ross.zwisler, dan.j.williams, fstests, linux-nvdimm
Change dm-flakey to implement direct_access function,
flakey_direct_access(), which maps sector and calls direct_access
function of its physical target device. This pretty much is a copy
from DM Linear.
This allows fs with DAX to pass in xfstests. It does not actually introduce
data corruption and dropping writes unlike the non-DAX path. The main
reason is due to the I/O path being out of dmflakey's control once
direct_access() has been called. The the existing implementation cannot
be adapted to DAX I/O path. The error injection will be introduced at a
later date with more thought.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/md/dm-flakey.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index 6a2e8dd..cf182a7 100644
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -408,9 +408,27 @@ static int flakey_iterate_devices(struct dm_target *ti, iterate_devices_callout_
return fn(ti, fc->dev, fc->start, ti->len, data);
}
+static long flakey_direct_access(struct dm_target *ti, sector_t sector,
+ void **kaddr, pfn_t *pfn, long size)
+{
+ struct flakey_c *fc = ti->private;
+ struct block_device *bdev = fc->dev->bdev;
+ struct blk_dax_ctl dax = {
+ .sector = flakey_map_sector(ti, sector),
+ .size = size,
+ };
+ long ret;
+
+ ret = bdev_direct_access(bdev, &dax);
+ *kaddr = dax.addr;
+ *pfn = dax.pfn;
+
+ return ret;
+}
+
static struct target_type flakey_target = {
.name = "flakey",
- .version = {1, 3, 1},
+ .version = {1, 4, 0},
.module = THIS_MODULE,
.ctr = flakey_ctr,
.dtr = flakey_dtr,
@@ -419,6 +437,7 @@ static struct target_type flakey_target = {
.status = flakey_status,
.prepare_ioctl = flakey_prepare_ioctl,
.iterate_devices = flakey_iterate_devices,
+ .direct_access = flakey_direct_access,
};
static int __init dm_flakey_init(void)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dm flakey: add DAX support
2016-09-20 20:47 [PATCH] dm flakey: add DAX support Dave Jiang
@ 2016-09-20 21:42 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2016-09-20 21:42 UTC (permalink / raw)
To: Dave Jiang
Cc: snitzer, agk, dm-devel, ross.zwisler, dan.j.williams, fstests,
linux-nvdimm
On Tue, Sep 20, 2016 at 01:47:34PM -0700, Dave Jiang wrote:
> Change dm-flakey to implement direct_access function,
> flakey_direct_access(), which maps sector and calls direct_access
> function of its physical target device. This pretty much is a copy
> from DM Linear.
>
> This allows fs with DAX to pass in xfstests.
They don't fail. They simply don't run like this:
generic/321 1s ... [not run] Cannot run tests with DAX on dmflakey devices
generic/322 0s ... [not run] Cannot run tests with DAX on dmflakey devices
> It does not actually introduce
> data corruption and dropping writes unlike the non-DAX path. The main
> reason is due to the I/O path being out of dmflakey's control once
> direct_access() has been called. The the existing implementation cannot
> be adapted to DAX I/O path. The error injection will be introduced at a
> later date with more thought.
Then introduce dmflakey DAX support at that time. Running tests that
are supposed to exercise failure paths when those failure paths
cannot be triggered is fundamentally useless. It leads a false
indication that we are actually testing failures, when in fact we
are doing nothing of the sort.
Right now the test harness execution clearly documents that there is
no failure testing being run on DAX devices, and that's the way it
should remain until dmflakey, dmerror, etc can inject the required
errors into the DAX paths....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-20 21:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 20:47 [PATCH] dm flakey: add DAX support Dave Jiang
2016-09-20 21:42 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox