Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1579780
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.9 03/60] libnvdimm, namespace: do not delete namespace-id 0 |
| Date | 2017-02-13 14:30 +0100 |
| Message-ID | <taoRC-4fA-57@gated-at.bofh.it> (permalink) |
| References | <taoyd-47y-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams@intel.com>
commit 9d032f4201d39e5cf43a8709a047e481f5723fdc upstream.
Given that the naming of pmem devices changes from the pmemX form to the
pmemX.Y form when namespace id is greater than 0, arrange for namespaces
with id-0 to be exempt from deletion. Otherwise a simple reconfiguration
of an existing namespace to a new mode results in a name change of the
resulting block device:
# ndctl list --namespace=namespace1.0
{
"dev":"namespace1.0",
"mode":"raw",
"size":2147483648,
"uuid":"3dadf3dc-89b9-4b24-b20e-abc8a4707ce3",
"blockdev":"pmem1"
}
# ndctl create-namespace --reconfig=namespace1.0 --mode=memory --force
{
"dev":"namespace1.1",
"mode":"memory",
"size":2111832064,
"uuid":"7b4a6341-7318-4219-a02c-fb57c0bbf613",
"blockdev":"pmem1.1"
}
This change does require tooling changes to explicitly look for
namespaceX.0 if the seed has already advanced to another namespace.
Fixes: 98a29c39dc68 ("libnvdimm, namespace: allow creation of multiple pmem-namespaces per region")
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvdimm/namespace_devs.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -962,8 +962,8 @@ static ssize_t __size_store(struct devic
struct nvdimm_drvdata *ndd;
struct nd_label_id label_id;
u32 flags = 0, remainder;
+ int rc, i, id = -1;
u8 *uuid = NULL;
- int rc, i;
if (dev->driver || ndns->claim)
return -EBUSY;
@@ -972,11 +972,13 @@ static ssize_t __size_store(struct devic
struct nd_namespace_pmem *nspm = to_nd_namespace_pmem(dev);
uuid = nspm->uuid;
+ id = nspm->id;
} else if (is_namespace_blk(dev)) {
struct nd_namespace_blk *nsblk = to_nd_namespace_blk(dev);
uuid = nsblk->uuid;
flags = NSLABEL_FLAG_LOCAL;
+ id = nsblk->id;
}
/*
@@ -1039,10 +1041,11 @@ static ssize_t __size_store(struct devic
/*
* Try to delete the namespace if we deleted all of its
- * allocation, this is not the seed device for the region, and
- * it is not actively claimed by a btt instance.
+ * allocation, this is not the seed or 0th device for the
+ * region, and it is not actively claimed by a btt, pfn, or dax
+ * instance.
*/
- if (val == 0 && nd_region->ns_seed != dev && !ndns->claim)
+ if (val == 0 && id != 0 && nd_region->ns_seed != dev && !ndns->claim)
nd_device_unregister(dev, ND_ASYNC);
return rc;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.9 00/60] 4.9.10-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 11/60] crypto: ccp - Fix double add when creating new DMA command Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 09/60] crypto: qat - zero esram only for DH85x devices Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 20/60] hns: avoid stack overflow with CONFIG_KASAN Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 05/60] dm rq: cope with DM device destruction while in dm_old_request_fn() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 21/60] ARM: 8643/3: arm/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 12/60] ARC: [arcompact] brown paper bag bug in unaligned access delay slot fixup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 18/60] mm/slub.c: fix random_seq offset destruction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 28/60] target: Fix multi-session dynamic se_node_acl double free OOPs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 03/60] libnvdimm, namespace: do not delete namespace-id 0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 24/60] drm/atomic: Fix double free in drm_atomic_state_default_clear Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 07/60] crypto: chcr - Check device is allocated before use Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 26/60] target: Use correct SCSI status during EXTENDED_COPY exception Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 02/60] acpi, nfit: fix acpi_nfit_flush_probe() crash Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 13/60] Input: uinput - fix crash when mixing old and new init style Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 19/60] ibmvscsis: Add SGL limit Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
[PATCH 4.9 25/60] target: Dont BUG_ON during NodeACL dynamic -> explicit conversion Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 14:30 +0100
Re: [PATCH 4.9 00/60] 4.9.10-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-02-13 18:10 +0100
Re: [PATCH 4.9 00/60] 4.9.10-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 18:30 +0100
Re: [PATCH 4.9 00/60] 4.9.10-stable review Guenter Roeck <linux@roeck-us.net> - 2017-02-13 21:10 +0100
Re: [PATCH 4.9 00/60] 4.9.10-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-15 00:00 +0100
csiph-web