[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211021001059.438843-7-jane.chu@oracle.com>
Date: Wed, 20 Oct 2021 18:10:59 -0600
From: Jane Chu <jane.chu@...cle.com>
To: david@...morbit.com, djwong@...nel.org, dan.j.williams@...el.com,
hch@...radead.org, vishal.l.verma@...el.com, dave.jiang@...el.com,
agk@...hat.com, snitzer@...hat.com, dm-devel@...hat.com,
ira.weiny@...el.com, willy@...radead.org, vgoyal@...hat.com,
linux-fsdevel@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org
Subject: [PATCH 6/6] dm: Ensure dm honors DAXDEV_F_RECOVERY flag on dax only
dm_dax_direct_access() supports DAXDEV_F_RECOVERY, so it may
translate a poisoned range. But if dm_dax_copy_to/from_iter()
don't have a dax_copy_to/from_iter() foundation underneath,
performing load/store over poisoned range is dangerous and
should be avoided.
Signed-off-by: Jane Chu <jane.chu@...cle.com>
---
drivers/md/dm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 764183ddebc1..5f7fe64d3c37 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1058,6 +1058,8 @@ static size_t dm_dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
if (!ti)
goto out;
if (!ti->type->dax_copy_from_iter) {
+ if (flags & DAXDEV_F_RECOVERY)
+ goto out;
ret = copy_from_iter(addr, bytes, i);
goto out;
}
@@ -1082,6 +1084,8 @@ static size_t dm_dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff,
if (!ti)
goto out;
if (!ti->type->dax_copy_to_iter) {
+ if (flags & DAXDEV_F_RECOVERY)
+ goto out;
ret = copy_to_iter(addr, bytes, i);
goto out;
}
--
2.18.4
Powered by blists - more mailing lists