[ndctl PATCH] ndctl, inject-smart: Fix man page to match the current behavior
by Vishal Verma
The inject-smart man page had a -H option for health status, which was
from a previous development iteration, and not how it actually works.
Fix it to advertise a -f flag for setting fatal status, and remove an
unnecessart '=' from the unsafe-shutdown option as it doesn't accept any
additional arguments.
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
Documentation/ndctl/ndctl-inject-smart.txt | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Documentation/ndctl/ndctl-inject-smart.txt b/Documentation/ndctl/ndctl-inject-smart.txt
index 0dc6481..20a1621 100644
--- a/Documentation/ndctl/ndctl-inject-smart.txt
+++ b/Documentation/ndctl/ndctl-inject-smart.txt
@@ -77,13 +77,12 @@ OPTIONS
--spares-alarm=::
Enable or disable the smart spares alarm. Options are 'on' or 'off'.
--H::
---health=::
- Smart attribute for health status. Provide either 'fatal' or 'nominal'
- to set the state of the attribute.
+-f::
+--fatal::
+ Set the flag to spoof fatal health status.
-U::
---unsafe-shutdown=::
+--unsafe-shutdown::
Set the flag to spoof an unsafe shutdown on the next power down.
-v::
--
2.14.4
4 years
[ndctl PATCH] ndctl, documentation: document the label-version option for init-labels
by Vishal Verma
Add the missing --label-verison option to the ndctl init-labels man
page.
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
Documentation/ndctl/ndctl-init-labels.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/ndctl/ndctl-init-labels.txt b/Documentation/ndctl/ndctl-init-labels.txt
index 736d52d..733ef0e 100644
--- a/Documentation/ndctl/ndctl-init-labels.txt
+++ b/Documentation/ndctl/ndctl-init-labels.txt
@@ -83,6 +83,11 @@ include::labels-options.txt[]
be an existing / valid namespace index. Warning, this will
destroy all defined namespaces on the dimm.
+-V::
+--label-version::
+ Initialize with a specific version of labels from the namespace
+ label specification. Defaults to 1.1
+
include::../copyright.txt[]
SEE ALSO
--
2.14.4
4 years
Searching for a beloved prince is my main goal!
by afrit@chollian.co.kr
Good day, dear sir.
My name is Sevgi.
I am a woman, who believe in a destiny with a cheerful future for myself and that you could become a part of it.
I do want to be next to a loving man. I wish to find a man that can give me a real hope and love!
Hope you're interested in becoming a part of my adventure and will reply back soon!
If you are interested in getting to know me closer, please write to my personal e-mail - mssevgi88(a)yahoo.com
Your true soul,
Sevgi.
4 years
[PATCH v7 0/4] resource: Use list_head to link sibling resource
by Baoquan He
This patchset is doing:
1) Move reparent_resources() to kernel/resource.c to clean up duplicated
code in arch/microblaze/pci/pci-common.c and
arch/powerpc/kernel/pci-common.c .
2) Replace struct resource's sibling list from singly linked list to
list_head. Clearing out those pointer operation within singly linked
list for better code readability.
2) Based on list_head replacement, add a new function
walk_system_ram_res_rev() which can does reversed iteration on
iomem_resource's siblings.
3) Change kexec_file loading to search system RAM top down for kernel
loadin, using walk_system_ram_res_rev().
Note:
This patchset only passed testing on x86_64 arch with network
enabling. The thing we need pay attetion to is that a root resource's
child member need be initialized specifically with LIST_HEAD_INIT() if
statically defined or INIT_LIST_HEAD() for dynamically definition. Here
Just like we do for iomem_resource/ioport_resource, or the change in
get_pci_domain_busn_res().
v6:
http://lkml.kernel.org/r/20180704041038.8190-1-bhe@redhat.com
v5:
http://lkml.kernel.org/r/20180612032831.29747-1-bhe@redhat.com
v4:
http://lkml.kernel.org/r/20180507063224.24229-1-bhe@redhat.com
v3:
http://lkml.kernel.org/r/20180419001848.3041-1-bhe@redhat.com
v2:
http://lkml.kernel.org/r/20180408024724.16812-1-bhe@redhat.com
v1:
http://lkml.kernel.org/r/20180322033722.9279-1-bhe@redhat.com
Changelog:
v6->v7:
Fix code bugs that test robot reported on mips and ia64.
Add error code description in reparent_resources() according to
Andy's comment, and fix minor log typo.
v5->v6:
Fix code style problems in reparent_resources() and use existing
error codes, according to Andy's suggestion.
Fix bugs test robot reported.
v4->v5:
Add new patch 0001 to move duplicated reparent_resources() to
kernel/resource.c to make it be shared by different ARCH-es.
Fix several code bugs reported by test robot on ARCH powerpc and
microblaze.
v3->v4:
Fix several bugs test robot reported. Rewrite cover letter and patch
log according to reviewer's comment.
v2->v3:
Rename resource functions first_child() and sibling() to
resource_first_chils() and resource_sibling(). Dan suggested this.
Move resource_first_chils() and resource_sibling() to linux/ioport.h
and make them as inline function. Rob suggested this. Accordingly add
linux/list.h including in linux/ioport.h, please help review if this
bring efficiency degradation or code redundancy.
The change on struct resource {} bring two pointers of size increase,
mention this in git log to make it more specifically, Rob suggested
this.
v1->v2:
Use list_head instead to link resource siblings. This is suggested by
Andrew.
Rewrite walk_system_ram_res_rev() after list_head is taken to link
resouce siblings.
Baoquan He (4):
resource: Move reparent_resources() to kernel/resource.c and make it
public
resource: Use list_head to link sibling resource
resource: add walk_system_ram_res_rev()
kexec_file: Load kernel at top of system RAM if required
arch/arm/plat-samsung/pm-check.c | 6 +-
arch/ia64/sn/kernel/io_init.c | 2 +-
arch/microblaze/pci/pci-common.c | 41 +----
arch/mips/pci/pci-rc32434.c | 12 +-
arch/powerpc/kernel/pci-common.c | 39 +---
arch/sparc/kernel/ioport.c | 2 +-
arch/xtensa/include/asm/pci-bridge.h | 4 +-
drivers/eisa/eisa-bus.c | 2 +
drivers/gpu/drm/drm_memory.c | 3 +-
drivers/gpu/drm/gma500/gtt.c | 5 +-
drivers/hv/vmbus_drv.c | 52 +++---
drivers/input/joystick/iforce/iforce-main.c | 4 +-
drivers/nvdimm/namespace_devs.c | 6 +-
drivers/nvdimm/nd.h | 5 +-
drivers/of/address.c | 4 +-
drivers/parisc/lba_pci.c | 4 +-
drivers/pci/controller/vmd.c | 8 +-
drivers/pci/probe.c | 2 +
drivers/pci/setup-bus.c | 2 +-
include/linux/ioport.h | 21 ++-
kernel/kexec_file.c | 2 +
kernel/resource.c | 266 ++++++++++++++++++----------
22 files changed, 260 insertions(+), 232 deletions(-)
--
2.13.6
4 years
nqooufnf krntkei bnwvyzxc
by Alban
Hello linux-nvdimm(a)lists.01.org [rgjinpd]
Only we have a base of 250 million e-mail addresses of businessmen from all over the world for $500. 7753191 [iztfpet]
1000 000 e-mail addresses for $2 Cheaper no, no where. [pdrrd]
Our contacts:andrey100077@gmail.com [bdcblmcp]
7753191[biirc]
Здравствуйте linux-nvdimm(a)lists.01.org [uuqtx]
Только у нас база 250 миллионов e-mail адресов бизнесменов всего Мира за $500. [rotajpgs]
1000 000 e-mail адресов по $2 Дешевле нет не где. [rtcsfgnw]
Наши контакты: andrey100077(a)gmail.com [whxhf]
77531917753191 [zvdejqo]
[rtfrftwcci]
[dwxkvcmvo]
4 years
[ndctl PATCH] ndctl, monitor: fix a resource leak in parse_monitor_event
by Vishal Verma
Static analysis reports we leak dimm_event in the above function.
Fix it by adding an 'out' label for all exit paths, and refactoring out
the 'all events' cases.
Fixes: fdf6b6844ccf ("ndctl, monitor: add a new command - monitor")
Cc: QI Fuli <qi.fuli(a)jp.fujitsu.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
ndctl/monitor.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index dbad7aa..b97d1ea 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -410,22 +410,35 @@ static int monitor_event(struct ndctl_ctx *ctx,
return rc;
}
+static void monitor_enable_all_events(struct monitor *_monitor)
+{
+ _monitor->event_flags = ND_EVENT_SPARES_REMAINING
+ | ND_EVENT_MEDIA_TEMPERATURE
+ | ND_EVENT_CTRL_TEMPERATURE
+ | ND_EVENT_HEALTH_STATE
+ | ND_EVENT_UNCLEAN_SHUTDOWN;
+}
+
static int parse_monitor_event(struct monitor *_monitor, struct ndctl_ctx *ctx)
{
char *dimm_event, *save;
const char *event;
+ int rc = 0;
+
+ if (!_monitor->dimm_event) {
+ monitor_enable_all_events(_monitor);
+ return 0;;
+ }
- if (!_monitor->dimm_event)
- goto dimm_event_all;
dimm_event = strdup(_monitor->dimm_event);
if (!dimm_event)
- return 1;
+ return -ENOMEM;
for (event = strtok_r(dimm_event, " ", &save); event;
event = strtok_r(NULL, " ", &save)) {
if (strcmp(event, "all") == 0) {
- free(dimm_event);
- goto dimm_event_all;
+ monitor_enable_all_events(_monitor);
+ goto out;
}
if (strcmp(event, "dimm-spares-remaining") == 0)
_monitor->event_flags |= ND_EVENT_SPARES_REMAINING;
@@ -439,20 +452,14 @@ static int parse_monitor_event(struct monitor *_monitor, struct ndctl_ctx *ctx)
_monitor->event_flags |= ND_EVENT_UNCLEAN_SHUTDOWN;
else {
err(ctx, "no dimm-event named %s\n", event);
- return 1;
+ rc = -EINVAL;
+ goto out;
}
}
+out:
free(dimm_event);
- return 0;
-
-dimm_event_all:
- _monitor->event_flags = ND_EVENT_SPARES_REMAINING
- | ND_EVENT_MEDIA_TEMPERATURE
- | ND_EVENT_CTRL_TEMPERATURE
- | ND_EVENT_HEALTH_STATE
- | ND_EVENT_UNCLEAN_SHUTDOWN;
- return 0;
+ return rc;
}
static void parse_config(const char **arg, char *key, char *val, char *ident)
--
2.14.4
4 years
[PATCHv4 1/2] libnvdimm: Use max contiguous area for namespace size
by Keith Busch
This patch will find the max contiguous area to determine the largest
pmem namespace size that can be created. If the requested size exceeds
the largest available, ENOSPC error will be returned.
This fixes the allocation underrun error and wrong error return code
that have otherwise been observed as the following kernel warning:
WARNING: CPU: <CPU> PID: <PID> at drivers/nvdimm/namespace_devs.c:913 size_store
Fixes: a1f3e4d6a0c3 ("libnvdimm, region: update nd_region_available_dpa() for multi-pmem support")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Keith Busch <keith.busch(a)intel.com>
---
v3 -> v4:
Actually constrain the reserved pmem to the region under consideration
rather than the mapping's dimm. This is done by directly calling
__reserve_free_pmem with the region's device instead of walking the
parent devices children. Thanks to Vishal Verma for reporting how
to trigger the incorrect reportings.
Fixed a possible NULL deref, from Gustavo A. R. Silva.
drivers/nvdimm/dimm_devs.c | 31 +++++++++++++++++++++++++++++++
drivers/nvdimm/namespace_devs.c | 6 +++---
drivers/nvdimm/nd-core.h | 8 ++++++++
drivers/nvdimm/region_devs.c | 24 ++++++++++++++++++++++++
4 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index 8d348b22ba45..863cabc35215 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -536,6 +536,37 @@ resource_size_t nd_blk_available_dpa(struct nd_region *nd_region)
return info.available;
}
+/**
+ * nd_pmem_max_contiguous_dpa - For the given dimm+region, return the max
+ * contiguous unallocated dpa range.
+ * @nd_region: constrain available space check to this reference region
+ * @nd_mapping: container of dpa-resource-root + labels
+ */
+resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
+ struct nd_mapping *nd_mapping)
+{
+ struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
+ struct nvdimm_bus *nvdimm_bus;
+ resource_size_t max = 0;
+ struct resource *res;
+
+ /* if a dimm is disabled the available capacity is zero */
+ if (!ndd)
+ return 0;
+
+ nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
+ if (__reserve_free_pmem(&nd_region->dev, nd_mapping->nvdimm))
+ return 0;
+ for_each_dpa_resource(ndd, res) {
+ if (strcmp(res->name, "pmem-reserve") != 0)
+ continue;
+ if (resource_size(res) > max)
+ max = resource_size(res);
+ }
+ release_free_pmem(nvdimm_bus, nd_mapping);
+ return max;
+}
+
/**
* nd_pmem_available_dpa - for the given dimm+region account unallocated dpa
* @nd_mapping: container of dpa-resource-root + labels
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index cb322f2bc605..4a4266250c28 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -799,7 +799,7 @@ static int merge_dpa(struct nd_region *nd_region,
return 0;
}
-static int __reserve_free_pmem(struct device *dev, void *data)
+int __reserve_free_pmem(struct device *dev, void *data)
{
struct nvdimm *nvdimm = data;
struct nd_region *nd_region;
@@ -836,7 +836,7 @@ static int __reserve_free_pmem(struct device *dev, void *data)
return 0;
}
-static void release_free_pmem(struct nvdimm_bus *nvdimm_bus,
+void release_free_pmem(struct nvdimm_bus *nvdimm_bus,
struct nd_mapping *nd_mapping)
{
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
@@ -1032,7 +1032,7 @@ static ssize_t __size_store(struct device *dev, unsigned long long val)
allocated += nvdimm_allocated_dpa(ndd, &label_id);
}
- available = nd_region_available_dpa(nd_region);
+ available = nd_region_allocatable_dpa(nd_region);
if (val > available + allocated)
return -ENOSPC;
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h
index 79274ead54fb..ac68072fb8cd 100644
--- a/drivers/nvdimm/nd-core.h
+++ b/drivers/nvdimm/nd-core.h
@@ -100,6 +100,14 @@ struct nd_region;
struct nvdimm_drvdata;
struct nd_mapping;
void nd_mapping_free_labels(struct nd_mapping *nd_mapping);
+
+int __reserve_free_pmem(struct device *dev, void *data);
+void release_free_pmem(struct nvdimm_bus *nvdimm_bus,
+ struct nd_mapping *nd_mapping);
+
+resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
+ struct nd_mapping *nd_mapping);
+resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
struct nd_mapping *nd_mapping, resource_size_t *overlap);
resource_size_t nd_blk_available_dpa(struct nd_region *nd_region);
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index ec3543b83330..c30d5af02cc2 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -389,6 +389,30 @@ resource_size_t nd_region_available_dpa(struct nd_region *nd_region)
return available;
}
+resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region)
+{
+ resource_size_t available = 0;
+ int i;
+
+ if (is_memory(&nd_region->dev))
+ available = PHYS_ADDR_MAX;
+
+ WARN_ON(!is_nvdimm_bus_locked(&nd_region->dev));
+ for (i = 0; i < nd_region->ndr_mappings; i++) {
+ struct nd_mapping *nd_mapping = &nd_region->mapping[i];
+
+ if (is_memory(&nd_region->dev))
+ available = min(available,
+ nd_pmem_max_contiguous_dpa(nd_region,
+ nd_mapping));
+ else if (is_nd_blk(&nd_region->dev))
+ available += nd_blk_available_dpa(nd_region);
+ }
+ if (is_memory(&nd_region->dev))
+ return available * nd_region->ndr_mappings;
+ return available;
+}
+
static ssize_t available_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
--
2.14.4
4 years
[PATCH] libnvdimm: fix NULL pointer dereference
by Gustavo A. R. Silva
ndd is being dereferenced before it is null checked, hence there is a
potential null pointer dereference.
Fix this by moving the pointer dereference after ndd has been properly
null checked at line 554: if (!ndd)
Addresses-Coverity-ID: 1472020 ("Dereference before null check")
Fixes: 42218e643bd2 ("libnvdimm: Use max contiguous area for namespace size")
Signed-off-by: Gustavo A. R. Silva <gustavo(a)embeddedor.com>
---
drivers/nvdimm/dimm_devs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index 9e977cb..1dc3125 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -546,7 +546,7 @@ resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
struct nd_mapping *nd_mapping)
{
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
- struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
+ struct nvdimm_bus *nvdimm_bus;
resource_size_t max = 0;
struct resource *res;
@@ -554,6 +554,8 @@ resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
if (!ndd)
return 0;
+ nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
+
if (reserve_free_pmem(nvdimm_bus, nd_mapping))
return 0;
for_each_dpa_resource(ndd, res) {
--
2.7.4
4 years
[PATCH 0/5] Do not request a pointer kaddr when not required
by Huaisheng Ye
From: Huaisheng Ye <yehs1(a)lenovo.com>
Some functions within fs/dax and dax/super don't need to get kaddr from
direct_access. Assigning NULL to kaddr to ->direct_access() is more
straightforward and simple than offering a useless local pointer.
So all direct_access() need to check the validity of second rank pointer
kaddr for NULL assignment. If kaddr equals to NULL, it doesn't need to
calculate its value.
* This series are supplement to [PATCH v2 00/14]mm: Asynchronous +
multithreaded memmap init for ZONE_DEVICE. [1]
[1]: https://lkml.org/lkml/2018/7/16/828
Huaisheng Ye (5):
libnvdimm, pmem: Allow a NULL-kaddr to ->direct_access()
tools/testing/nvdimm: Allow a NULL-kaddr to ->direct_access()
s390, dcssblk: Allow a NULL-kaddr to ->direct_access()
filesystem-dax: Do not request a pointer kaddr when not required
dax/super: Do not request a pointer kaddr when not required
drivers/dax/super.c | 3 +--
drivers/nvdimm/pmem.c | 4 +++-
drivers/s390/block/dcssblk.c | 3 ++-
fs/dax.c | 3 +--
tools/testing/nvdimm/pmem-dax.c | 6 ++++--
5 files changed, 11 insertions(+), 8 deletions(-)
--
1.8.3.1
4 years