Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
"Two fixes:

- a regression fix for the multiple-pmem-namespace-per-region support
added in 4.9. Even if an existing environment is not using that
feature the act of creating and a destroying a single namespace
with the ndctl utility will lead to the proliferation of extra
unwanted namespace devices.

- a fix for the error code returned from the pmem driver when the
memcpy_mcsafe() routine returns -EFAULT. Btrfs seems to be the only
block I/O consumer that tries to parse the meaning of the error
code when it is non-zero.

Neither of these fixes are critical, the namespace leak is awkward in
that it can cause device naming to change and complicates debugging
namespace initialization issues. The error code fix is included out of
caution for what other consumers might be expecting -EIO for block I/O
errors"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero
pmem: return EIO on read_pmem() failure

+13 -14
+10 -13
drivers/nvdimm/namespace_devs.c
··· 957 957 { 958 958 resource_size_t allocated = 0, available = 0; 959 959 struct nd_region *nd_region = to_nd_region(dev->parent); 960 + struct nd_namespace_common *ndns = to_ndns(dev); 960 961 struct nd_mapping *nd_mapping; 961 962 struct nvdimm_drvdata *ndd; 962 963 struct nd_label_id label_id; ··· 965 964 u8 *uuid = NULL; 966 965 int rc, i; 967 966 968 - if (dev->driver || to_ndns(dev)->claim) 967 + if (dev->driver || ndns->claim) 969 968 return -EBUSY; 970 969 971 970 if (is_namespace_pmem(dev)) { ··· 1035 1034 1036 1035 nd_namespace_pmem_set_resource(nd_region, nspm, 1037 1036 val * nd_region->ndr_mappings); 1038 - } else if (is_namespace_blk(dev)) { 1039 - struct nd_namespace_blk *nsblk = to_nd_namespace_blk(dev); 1040 - 1041 - /* 1042 - * Try to delete the namespace if we deleted all of its 1043 - * allocation, this is not the seed device for the 1044 - * region, and it is not actively claimed by a btt 1045 - * instance. 1046 - */ 1047 - if (val == 0 && nd_region->ns_seed != dev 1048 - && !nsblk->common.claim) 1049 - nd_device_unregister(dev, ND_ASYNC); 1050 1037 } 1038 + 1039 + /* 1040 + * Try to delete the namespace if we deleted all of its 1041 + * allocation, this is not the seed device for the region, and 1042 + * it is not actively claimed by a btt instance. 1043 + */ 1044 + if (val == 0 && nd_region->ns_seed != dev && !ndns->claim) 1045 + nd_device_unregister(dev, ND_ASYNC); 1051 1046 1052 1047 return rc; 1053 1048 }
+3 -1
drivers/nvdimm/pmem.c
··· 90 90 91 91 rc = memcpy_from_pmem(mem + off, pmem_addr, len); 92 92 kunmap_atomic(mem); 93 - return rc; 93 + if (rc) 94 + return -EIO; 95 + return 0; 94 96 } 95 97 96 98 static int pmem_do_bvec(struct pmem_device *pmem, struct page *page,