aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/claim.c
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2017-08-30 19:35:58 -0600
committerDan Williams <dan.j.williams@intel.com>2017-08-31 14:31:38 -0700
commit1db1f3cea1d8886c686832d4618b346ae16c03c8 (patch)
treece3cec4310270efbfec5b124ff5439e62e4bf26e /drivers/nvdimm/claim.c
parentlibnvdimm, nfit: export an 'ecc_unit_size' sysfs attribute (diff)
downloadlinux-dev-1db1f3cea1d8886c686832d4618b346ae16c03c8.tar.xz
linux-dev-1db1f3cea1d8886c686832d4618b346ae16c03c8.zip
libnvdimm, btt: fix a missed NVDIMM_IO_ATOMIC case in the write path
The IO context conversion for rw_bytes missed a case in the BTT write path (btt_map_write) which should've been marked as atomic. In reality this should not cause a problem, because map writes are to small for nsio_rw_bytes to attempt error clearing, but it should be fixed for posterity. Add a might_sleep() in the non-atomic section of nsio_rw_bytes so that things like the nfit unit tests, which don't actually sleep, can catch bugs like this. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/claim.c')
-rw-r--r--drivers/nvdimm/claim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 47770460f3d3..3e6404f1ba5a 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -292,6 +292,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
&& !(flags & NVDIMM_IO_ATOMIC)) {
long cleared;
+ might_sleep();
cleared = nvdimm_clear_poison(&ndns->dev,
nsio->res.start + offset, size);
if (cleared < size)