[PATCH v3 0/3] Fix DM DAX handling
by Ross Zwisler
This series fixes a few issues that I found with DM's handling of DAX
devices. Here are some of the issues I found:
* We can create a dm-stripe or dm-linear device which is made up of an
fsdax PMEM namespace and a raw PMEM namespace but which can hold a
filesystem mounted with the -o dax mount option. DAX operations to
the raw PMEM namespace part lack struct page and can fail in
interesting/unexpected ways when doing things like fork(), examining
memory with gdb, etc.
* We can create a dm-stripe or dm-linear device which is made up of an
fsdax PMEM namespace and a BRD ramdisk which can hold a filesystem
mounted with the -o dax mount option. All I/O to this filesystem
will fail.
---
Changes since v2:
* Only set QUEUE_FLAG_DAX for fsdax mode PMEM namespaces. (Mike)
* Check for QUEUE_FLAG_DAX in __bdev_dax_supported(). (Mike)
* Get rid of DM_TYPE_DAX_BIO_BASED reworks. (Mike)
* Dropped the first 2 prep patches of v2 since they were merged for
v4.18-rc1. (Thanks, Darrick!)
---
Mike, can you take this series through your tree?
Personally I think this should be treated as a bug fix and merged in the
v4.18-rc* series.
Ross Zwisler (3):
pmem: only set QUEUE_FLAG_DAX for fsdax mode
dax: bdev_dax_supported() check for QUEUE_FLAG_DAX
dm: prevent DAX mounts if not supported
drivers/dax/super.c | 8 ++++++++
drivers/md/dm-ioctl.c | 5 +++++
drivers/md/dm-table.c | 7 +++----
drivers/md/dm.c | 3 +--
drivers/nvdimm/pmem.c | 3 ++-
include/linux/device-mapper.h | 5 +++++
6 files changed, 24 insertions(+), 7 deletions(-)
--
2.14.4
2 years, 8 months
[PATCH] acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value
by Dave Jiang
cmd_rc is passed in by reference to the acpi_nfit_ctl() function and the
caller expects a value returned. However, when the package is pass through
via the ND_CMD_CALL command, cmd_rc is not touched. Make sure cmd_rc is
always set.
Fixes: aef253382266 ("libnvdimm, nfit: centralize command status translation")
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
drivers/acpi/nfit/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 7327b6a11ca9..2be8373153ed 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -408,6 +408,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
const guid_t *guid;
int rc, i;
+ *cmd_rc = -EINVAL;
func = cmd;
if (cmd == ND_CMD_CALL) {
call_pkg = buf;
@@ -518,6 +519,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
* If we return an error (like elsewhere) then caller wouldn't
* be able to rely upon data returned to make calculation.
*/
+ *cmd_rc = 0;
return 0;
}
2 years, 8 months
[ndctl PATCH] ndctl: Add CONTRIBUTING.md
by Vishal Verma
We were missing a CONTRIBUTING file to help new contributors follow the
expected guidelines. Add one that refers to the Linux Kernel for most of
these things, such as Coding style, Submitting Patches, and the DCO.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..aa9e78d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,31 @@
+# Contributing to ndctl
+
+Thanks for taking the time to contribute to ndctl.
+
+The following is a set of guidelines that we adhere to, and request that
+contributors follow.
+
+1. The libnvdimm (kernel subsystem) and ndctl developers primarily use
+ the [linux-nvdimm](https://lists.01.org/mailman/listinfo/linux-nvdimm)
+ mailing list for discussions as well as posting patches.
+1. Github [issues](https://github.com/pmem/ndctl/issues) are an acceptable
+ way to report a problem, but if you just have a question,
+ [email](mailto:linux-nvdimm@lists.01.org) the above list.
+1. We follow the Linux Kernel [Coding Style Guide][cs] as applicable.
+
+ [cs]: https://www.kernel.org/doc/html/latest/process/coding-style.html
+
+1. We follow the Linux Kernel [Submitting Patches Guide][sp] as applicable.
+
+ [sp]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html
+
+1. We follow the Linux Kernel [DCO][dco] (Developer Certificate of Origin).
+ The DCO is an attestation attached to every contribution made by every
+ developer. In the commit message of the contribution, the developer simply
+ adds a Signed-off-by statement and thereby agrees to the DCO.
+
+ [dco]: https://developercertificate.org/
+
+1. Github Pull Requests are acceptable, but won't be merged directly, as
+ Github doesn't allow for the kernel style flow of patches where a maintainer
+ also signs off on the patches they apply.
--
2.14.4
2 years, 8 months
[PATCH] mm: reject MAP_SHARED_VALIDATE without new flags
by Eric Sandeen
mmap(2) says the syscall will return EINVAL if "flags contained neither
MAP_PRIVATE or MAP_SHARED, or contained both of these values."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
However, commit
1c972597 ("mm: introduce MAP_SHARED_VALIDATE ...")
introduced a new flag, MAP_SHARED_VALIDATE, with a value of 0x3,
which is indistinguishable from (MAP_SHARED|MAP_PRIVATE).
Thus the invalid flag combination of (MAP_SHARED|MAP_PRIVATE) now
passes without error, which is a regression.
I'm not sure of the best way out of this, other than to change the
API description to say that MAP_SHARED_VALIDATE is only allowed in
combination with "new" flags, and reject it if it's used only with
flags contained in LEGACY_MAP_MASK.
This will require the mmap(2) manpage to enumerate which flags don't
require validation, as well, so the user knows when to use the
VALIDATE flag.
I'm not super happy with this, because it also means that code
which explicitly asks for mmap(MAP_SHARED|MAP_PRIVATE|MAP_SYNC) will
also pass, but I'm not sure there's anything to do about that.
Reported-by: Zhibin Li <zhibli(a)redhat.com>
Signed-off-by: Eric Sandeen <sandeen(a)redhat.com>
---
diff --git a/mm/mmap.c b/mm/mmap.c
index d1eb87ef4b1a..b1dc84466365 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1440,6 +1440,16 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
if (!file_mmap_ok(file, inode, pgoff, len))
return -EOVERFLOW;
+ /*
+ * MAP_SHARED_VALIDATE is indistinguishable from
+ * (MAP_SHARED|MAP_PRIVATE) which must return -EINVAL.
+ * If the flags contain MAP_SHARED_VALIDATE and none of the
+ * non-legacy flags, the user gets EINVAL.
+ */
+ if (((flags & MAP_SHARED_VALIDATE) == MAP_SHARED_VALIDATE) &&
+ !(flags & ~LEGACY_MAP_MASK)) {
+ return -EINVAL;
+ }
flags_mask = LEGACY_MAP_MASK | file->f_op->mmap_supported_flags;
2 years, 8 months
[PATCH v8 0/3] ndctl, monitor: add ndctl monitor daemon
by QI Fuli
This is the v8 patch for ndctl monitor, a tiny daemon to monitor
the smart events of nvdimm DIMMs. Since NVDIMM does not have a
feature like mirroring, if it breaks down, the data will be
impossible to restore. Ndctl monitor daemon will catch the smart
events notify from firmware and outputs notification to logfile,
therefore users can replace NVDIMM before it is completely broken.
Signed-off-by: QI Fuli <qi.fuli(a)jp.fujitsu.com>
---
Change log since v7:
- Replacing logreport() with log_file() and log_syslog()
- Refactoring read_config_file()
- Replacing set_confile() with parse_config()
- Fixing the ndctl/ndct.conf file
Change log since v6:
- Changing License to GPL-2.0
- Adding event object to output notification
- Adding [--dimm-event] option to filter notification by event type
- Rewriting read_config_file()
- Replacing monitor_dimm_event() with monitor_event()
- Renaming some variables
Change log since v5:
- Fixing systemd unit file cannot be installed bug
- Adding license to ./util/abspath.c
Change log since v4:
- Adding OPTION_FILENAME to make sure filename is correct
- Adding configuration file
- Adding [--config-file] option to override the default configuration
- Making some options support multiple space-seperated arguments
- Making systemctl enable ndctl-monitor.service command work
- Making systemctl restart ndctl-monitor.service command work
- Making the directory of systemd unit file to be configurable
- Changing log_file() and log_syslog() to logreport()
- Changing date format in notification to nanoseconds since epoch
- Changing select() to epoll()
- Adding filter_bus() and filter_region()
Change log since v3:
- Removing create-monitor, show-monitor, list-monitor, destroy-monitor
- Adding [--daemon] option to run ndctl monitor as a daemon
- Using systemd to manage ndctl monitor daemon
- Replacing filter_monitor_dimm() with filter_dimm()
Change log since v2:
- Changing the interface of daemon to the ndctl command line
- Changing the name of daemon form "nvdimmd" to "monitor"
- Removing the config file, unit_file, nvdimmd dir
- Removing nvdimmd_test program
- Adding ndctl/monitor.c
Change log since v1:
- Adding a config file(/etc/nvdimmd/nvdimmd.conf)
- Using struct log_ctx instead of syslog()
- Using log_syslog() to save the notify messages to syslog
- Using log_file() to save the notify messages to special file
- Adding LOG_NOTICE level to log_priority
- Using automake instead of Makefile
- Adding a new util file(nvdimmd/util.c) including helper functions
needed for nvdimm daemon
- Adding nvdimmd_test program
QI Fuli (3):
ndctl, monitor: add ndctl monitor
ndctl, monitor: add main ndctl monitor configuration file
ndctl, monitor: add the unit file of systemd for ndctl-monitor service
autogen.sh | 3 +-
builtin.h | 1 +
configure.ac | 22 ++
ndctl/Makefile.am | 12 +-
ndctl/monitor.c | 623 ++++++++++++++++++++++++++++++++++++
ndctl/monitor.conf | 41 +++
ndctl/ndctl-monitor.service | 7 +
ndctl/ndctl.c | 1 +
8 files changed, 708 insertions(+), 2 deletions(-)
create mode 100644 ndctl/monitor.c
create mode 100644 ndctl/monitor.conf
create mode 100644 ndctl/ndctl-monitor.service
--
2.17.1
2 years, 8 months
[ndctl PATCH] Documentation: add a newline in namespace Theory of Operations
by Vishal Verma
The first bullet in the modes description was merged in with the
previous paragraph in the online version of the man pages. Fix by adding
a newline before the bulleted list.
Reported-by: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
Documentation/ndctl/namespace-description.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/ndctl/namespace-description.txt b/Documentation/ndctl/namespace-description.txt
index 1dd687e..94999e5 100644
--- a/Documentation/ndctl/namespace-description.txt
+++ b/Documentation/ndctl/namespace-description.txt
@@ -21,6 +21,7 @@ area.
A namespace can be provisioned to operate in one of 4 modes, 'fsdax',
'devdax', 'sector', and 'raw'. Here are the expected usage models for
these modes:
+
- fsdax: Filesystem-DAX mode is the default mode of a namespace
when specifying 'ndctl create-namespace' with no options. It creates
a block device (/dev/pmemX[.Y]) that supports the DAX capabilities
--
2.14.4
2 years, 8 months
[PATCH 0/2] ext4: fix DAX dma vs truncate/hole-punch
by Ross Zwisler
This series from Dan:
https://lists.01.org/pipermail/linux-nvdimm/2018-March/014913.html
added synchronization between DAX dma and truncate/hole-punch in XFS.
This short series adds analogous support to ext4.
I've added calls to ext4_break_layouts() everywhere that ext4 removes
blocks from an inode's map.
The timings in XFS are such that it's difficult to hit this race. Dan
was able to show the race by manually introducing delays in the direct
I/O path.
For ext4, though, its trivial to hit this race, and a hit will result in
a trigger of this WARN_ON_ONCE() in dax_disassociate_entry():
WARN_ON_ONCE(trunc && page_ref_count(page) > 1);
I've made an xfstest which tests all the paths where we now call
ext4_break_layouts(), with the exception of the site in
ext4_truncate_failed_write() which is an error path. Each of the other
4 paths easily hits this race many times in my test setup with the
xfstest. I'll post this test shortly.
With these patches applied, I've still seen occasional hits of the above
WARN_ON_ONCE(), which tells me that we still have some work to do. I'll
continue looking at these more rare hits while we review this set.
Ross Zwisler (2):
dax: dax_layout_busy_page() warn on !exceptional
ext4: handle layout changes to pinned DAX mappings
fs/dax.c | 9 ++++++++-
fs/ext4/ext4.h | 1 +
fs/ext4/extents.c | 12 ++++++++++++
fs/ext4/inode.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
fs/ext4/truncate.h | 1 +
5 files changed, 70 insertions(+), 1 deletion(-)
--
2.14.4
2 years, 8 months
[patch,v2] dev-dax: check_vma: ratelimit dev_info-s
by Jeff Moyer
This is easily triggered from userspace, so let's ratelimit the
messages.
Signed-off-by: Jeff Moyer <jmoyer(a)redhat.com>
---
v2 - fix up all of the dev_info calls in check_vma
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index de2f8297a210..108c37fca782 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -189,14 +189,16 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
/* prevent private mappings from being established */
if ((vma->vm_flags & VM_MAYSHARE) != VM_MAYSHARE) {
- dev_info(dev, "%s: %s: fail, attempted private mapping\n",
+ dev_info_ratelimited(dev,
+ "%s: %s: fail, attempted private mapping\n",
current->comm, func);
return -EINVAL;
}
mask = dax_region->align - 1;
if (vma->vm_start & mask || vma->vm_end & mask) {
- dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
+ dev_info_ratelimited(dev,
+ "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
current->comm, func, vma->vm_start, vma->vm_end,
mask);
return -EINVAL;
@@ -204,13 +206,15 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) == PFN_DEV
&& (vma->vm_flags & VM_DONTCOPY) == 0) {
- dev_info(dev, "%s: %s: fail, dax range requires MADV_DONTFORK\n",
+ dev_info_ratelimited(dev,
+ "%s: %s: fail, dax range requires MADV_DONTFORK\n",
current->comm, func);
return -EINVAL;
}
if (!vma_is_dax(vma)) {
- dev_info(dev, "%s: %s: fail, vma is not DAX capable\n",
+ dev_info_ratelimited(dev,
+ "%s: %s: fail, vma is not DAX capable\n",
current->comm, func);
return -EINVAL;
}
2 years, 8 months
Managed Service Providers (MSPs)
by arcelia.mcdonald@sharedstrikes.com
Hi,
I just wanted to check if you would be interested in a list of Managed
Service Providers (MSPs) and Managed Security Service Providers (MSSPs)?
• Managed Service Providers (MSP’s) – 25,000 unique companies
• Managed Security Service Providers (MSSP’s) – 7,520 unique
companies
IT Decision Makers – 6million
Business Decision Makers – 10 million
Kindly review and let me know if I can share more information on this.
I look forward to hearing from you.
Regards,
Abraham Solomon
MSP List Specialist
For Opt-Out reply with “Not Interested”.
2 years, 8 months