Re:[5] linux-net@vger.kernel.org We offer E-mail databases with 80% discount / Предлагаем E-mail базы с 80% скидкой
by Business Group (gclkjvq)
Hello linux-net(a)vger.kernel.org
We offer you an E-mail database for any country in the World with 80% discount.[wxczpahu]
For effective marketing, advertising, newsletters.[cqtal]
In order to quickly attract customers for your business.[dbztd]
Customers who bought our database, training and advice for free.[cxuhhmve]
Hurry, discounts are only 2 weeks.[fwblejbo]
Details by e-mail: andrey100077(a)gmail.com or by ICQ: 666784430 [jgwpwwlc]
Добрый день linux-net(a)vger.kernel.org
Предлагаем Вам E-mail базы по любой стране Мира с 80% скидкой.[yuoahc]
Для эффективный маркетинговых, рекламных, рассылок.[fcwwafg]
С целью быстрого привлечения клиентов для Вашего бизнеса.[rgrvzyfa]
Клиентам, купившим у нас базы, обучение и консультации бесплатно.[ckbhq]
Спешите, скидки только 2 недели.[babpbjon]
За детальной информацией обращайтесь: [lrspkd]
wbase(a)list.ru или по ICQ: 666784430 [kccyg]
2 years, 11 months
[GIT PULL] libnvdimm for 4.16
by Ross Zwisler
Hi Linus, please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-for-4.16
...to receive the libnvdimm update for 4.16.
All of these commits have shipped in -next and have received build verification
notices from 0day.
There is one small merge conflict that Michael Ellerman also noted in his pull
request. In Michael's tree the axonram driver was removed, and in our tree it
received two small updates. The merge can be trivially resolved by just
keeping the driver removed per Michael's tree.
Regarding the vmem_altmap patches, Michal Hocko took a quick look and while it
wasn't a full review he has future plans to reuse vmem_altmap in wider places
in the memory hotplug code, so he's in favor of getting it properly plumbed.
In case you wanted to inspect them or verify the merge I've also pushed the
three topic branches for this cycle to our nvdimm tree:
for-4.16/nfit
for-4.16/libnvdimm
for-4.16/dax
---
The following changes since commit a7f2766ac7c359216da4e714dc117c881e39a74a:
Merge branches 'acpi-gpio', 'acpi-button', 'acpi-battery' and 'acpi-video' (2018-01-18 03:02:16 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-for-4.16
for you to fetch changes up to ee95f4059a833839bf52972191b2d4c3d3cec552:
Merge branch 'for-4.16/nfit' into libnvdimm-for-next (2018-02-03 00:26:26 -0700)
----------------------------------------------------------------
libnvdimm for 4.16
* Require struct page by default for filesystem DAX to remove a number of
surprising failure cases. This includes failures with direct I/O, gdb and
fork(2).
* Add support for the new Platform Capabilities Structure added to the NFIT in
ACPI 6.2a. This new table tells us whether the platform supports flushing
of CPU and memory controller caches on unexpected power loss events.
* Revamp vmem_altmap and dev_pagemap handling to clean up code and better
support future future PCI P2P uses.
* Deprecate the ND_IOCTL_SMART_THRESHOLD command whose payload has become
out-of-sync with recent versions of the NVDIMM_FAMILY_INTEL spec, and
instead rely on the generic ND_CMD_CALL approach used by the two other IOCTL
families, NVDIMM_FAMILY_{HPE,MSFT}.
* Enhance nfit_test so we can test some of the new things added in version 1.6
of the DSM specification. This includes testing firmware download and
simulating the Last Shutdown State (LSS) status.
----------------------------------------------------------------
Christoph Hellwig (16):
memremap: provide stubs for vmem_altmap_offset and vmem_altmap_free
mm: don't export arch_add_memory
mm: don't export __add_pages
mm: pass the vmem_altmap to arch_add_memory and __add_pages
mm: pass the vmem_altmap to vmemmap_populate
mm: pass the vmem_altmap to arch_remove_memory and __remove_pages
mm: pass the vmem_altmap to vmemmap_free
mm: pass the vmem_altmap to memmap_init_zone
mm: split altmap memory map allocation from normal case
mm: merge vmem_altmap_alloc into altmap_alloc_block_buf
mm: move get_dev_pagemap out of line
mm: optimize dev_pagemap reference counting around get_dev_pagemap
memremap: remove to_vmem_altmap
memremap: simplify duplicate region handling in devm_memremap_pages
memremap: change devm_memremap_pages interface to use struct dev_pagemap
memremap: merge find_dev_pagemap into get_dev_pagemap
Colin Ian King (1):
libnvdimm, namespace: remove redundant initialization of 'nd_mapping'
Dan Williams (8):
nfit, libnvdimm: deprecate the generic SMART ioctl
tools/testing/nvdimm: smart alarm/threshold control
mm, dax: introduce pfn_t_special()
ext4: auto disable dax instead of failing mount
ext2: auto disable dax instead of failing mount
dax: require 'struct page' by default for filesystem dax
tools/testing/nvdimm: force nfit_test to depend on instrumented modules
libnvdimm, namespace: make min namespace size 4K
Dave Jiang (6):
acpi: nfit: Add support for detect platform CPU cache flush on power loss
acpi: nfit: add persistent memory control flag for nd_region
libnvdimm: expose platform persistence attribute for nd_region
nfit-test: Add platform cap support from ACPI 6.2a to test
libnvdimm/nfit_test: add firmware download emulation
libnvdimm/nfit_test: adding support for unit testing enable LSS status
Jan H. Schönherr (2):
mm: Fix memory size alignment in devm_memremap_pages_release()
mm: Fix devm_memremap_pages() collision handling
Jeff Moyer (1):
libnvdimm, btt: fix uninitialized err_lock
Logan Gunthorpe (1):
memremap: drop private struct page_map
Luis de Bethencourt (1):
device-dax: Fix trailing semicolon
Ross Zwisler (2):
Merge branch 'for-4.16/dax' into libnvdimm-for-next
Merge branch 'for-4.16/nfit' into libnvdimm-for-next
Toshi Kani (1):
acpi, nfit: fix register dimm error handling
arch/arm64/mm/mmu.c | 9 +-
arch/ia64/mm/discontig.c | 6 +-
arch/ia64/mm/init.c | 18 +-
arch/powerpc/mm/init_64.c | 17 +-
arch/powerpc/mm/mem.c | 11 +-
arch/powerpc/platforms/Kconfig | 1 +
arch/powerpc/sysdev/axonram.c | 2 +-
arch/s390/mm/init.c | 7 +-
arch/s390/mm/vmem.c | 6 +-
arch/sh/mm/init.c | 10 +-
arch/sparc/mm/init_64.c | 5 +-
arch/x86/mm/init_32.c | 9 +-
arch/x86/mm/init_64.c | 94 ++++---
drivers/acpi/nfit/core.c | 26 ++
drivers/acpi/nfit/nfit.h | 1 +
drivers/dax/device.c | 2 +-
drivers/dax/pmem.c | 20 +-
drivers/dax/super.c | 10 +
drivers/nvdimm/btt.c | 2 +-
drivers/nvdimm/bus.c | 3 -
drivers/nvdimm/namespace_devs.c | 2 +-
drivers/nvdimm/nd.h | 9 +-
drivers/nvdimm/pfn_devs.c | 27 +-
drivers/nvdimm/pmem.c | 41 +--
drivers/nvdimm/pmem.h | 1 +
drivers/nvdimm/region_devs.c | 13 +
drivers/s390/block/Kconfig | 1 +
drivers/s390/block/dcssblk.c | 3 +-
fs/Kconfig | 7 +
fs/ext2/super.c | 7 +-
fs/ext4/super.c | 9 +-
include/linux/libnvdimm.h | 11 +
include/linux/memory_hotplug.h | 29 +-
include/linux/memremap.h | 77 ++---
include/linux/mm.h | 22 +-
include/linux/pfn_t.h | 13 +
include/uapi/linux/ndctl.h | 56 +---
kernel/memremap.c | 174 +++++-------
mm/gup.c | 7 +-
mm/hmm.c | 13 +-
mm/memory.c | 16 +-
mm/memory_hotplug.c | 39 ++-
mm/page_alloc.c | 6 +-
mm/sparse-vmemmap.c | 67 ++---
mm/sparse.c | 43 +--
tools/testing/nvdimm/Kbuild | 4 +
tools/testing/nvdimm/acpi_nfit_test.c | 8 +
tools/testing/nvdimm/device_dax_test.c | 8 +
tools/testing/nvdimm/libnvdimm_test.c | 8 +
tools/testing/nvdimm/pmem_test.c | 8 +
tools/testing/nvdimm/test/iomap.c | 7 +-
tools/testing/nvdimm/test/nfit.c | 498 +++++++++++++++++++++++++++++----
tools/testing/nvdimm/test/nfit_test.h | 134 +++++++++
tools/testing/nvdimm/watermark.h | 21 ++
54 files changed, 1122 insertions(+), 526 deletions(-)
create mode 100644 tools/testing/nvdimm/acpi_nfit_test.c
create mode 100644 tools/testing/nvdimm/device_dax_test.c
create mode 100644 tools/testing/nvdimm/libnvdimm_test.c
create mode 100644 tools/testing/nvdimm/pmem_test.c
create mode 100644 tools/testing/nvdimm/watermark.h
2 years, 11 months
[PATCH] libnvdimm: remove redundant assignment to pointer 'dev'
by Colin King
From: Colin Ian King <colin.king(a)canonical.com>
Pointer dev is being assigned a value that is never read, it is being
re-assigned the same value later on, hence the initialization is redundant
and can be removed.
Cleans up clang warning:
drivers/nvdimm/pfn_devs.c:307:17: warning: Value stored to 'dev' during
its initialization is never read
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
drivers/nvdimm/pfn_devs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index f5c4e8c6e29d..2f4d18752c97 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -304,7 +304,7 @@ static const struct attribute_group *nd_pfn_attribute_groups[] = {
struct device *nd_pfn_devinit(struct nd_pfn *nd_pfn,
struct nd_namespace_common *ndns)
{
- struct device *dev = &nd_pfn->dev;
+ struct device *dev;
if (!nd_pfn)
return NULL;
--
2.15.1
2 years, 11 months
nvml/pmdk libvmmaloc segmentation fault when exit
by Xiong Zhou
Hi,
This happens when testing nvml or pmdk libvmmalloc library:
+ dmesg
[12890.676033] traps: test_libvmmallo[15789] general protection ip:7f3f01481a31 sp:7ffd85f4b7a0 error:0 in libvmmalloc.so.1.0.0[7f3f0146d000+3e000]
gdb output:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bada31 in arena_purge () from /usr/local/lib64/libvmmalloc.so.1
(gdb) bt
#0 0x00007ffff7bada31 in arena_purge () from /usr/local/lib64/libvmmalloc.so.1
#1 0x00007ffff7badcca in arena_dalloc_bin_run () from /usr/local/lib64/libvmmalloc.so.1
#2 0x00007ffff7baf0e0 in je_vmem_je_arena_dalloc_bin_locked () from /usr/local/lib64/libvmmalloc.so.1
#3 0x00007ffff7bc6d31 in je_vmem_je_tcache_bin_flush_small () from /usr/local/lib64/libvmmalloc.so.1
#4 0x00007ffff7bc761e in je_vmem_je_tcache_destroy () from /usr/local/lib64/libvmmalloc.so.1
#5 0x00007ffff7bc7895 in je_vmem_je_tcache_thread_cleanup () from /usr/local/lib64/libvmmalloc.so.1
#6 0x00007ffff7b9dccc in jemalloc_destructor () from /usr/local/lib64/libvmmalloc.so.1
#7 0x00007ffff7deb18a in _dl_fini () at dl-fini.c:253
#8 0x00007ffff7805b19 in __run_exit_handlers (status=0, listp=0x7ffff7b926c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#9 0x00007ffff7805b67 in __GI_exit (status=<optimized out>) at exit.c:99
#10 0x00007ffff77ee38c in __libc_start_main (main=0x40072d <main>, argc=1, ubp_av=0x7fffffffe388, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe378) at ../csu/libc-start.c:308
#11 0x0000000000400669 in _start ()
I did not find issue opening entry in github repo, hope it's ok
sending here.
Thanks,
Xiong
Full test log:
# ./nf.sh
+ cc -ggdb test_libvmmalloc.c '-DALLOC_SIZE=((size_t)(1UL << 8))' -o test_libvmmalloc -lvmmalloc
+ VMMALLOC_POOL_DIR=/daxmnt/
+ VMMALLOC_POOL_SIZE=1073741824
+ ./test_libvmmalloc
Testing ./test_libvmmalloc, alloc size 256
./nf.sh: line 47: 15789 Segmentation fault VMMALLOC_POOL_DIR=$MNT1/ VMMALLOC_POOL_SIZE=$pshift ./test_libvmmalloc
+ ldd -v ./test_libvmmalloc
linux-vdso.so.1 => (0x00007ffe4fdf9000)
libvmmalloc.so.1 => /usr/local/lib64/libvmmalloc.so.1 (0x00007f786ce1e000)
libc.so.6 => /lib64/libc.so.6 (0x00007f786ca51000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f786c835000)
/lib64/ld-linux-x86-64.so.2 (0x00007f786d060000)
Version information:
./test_libvmmalloc:
libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
/usr/local/lib64/libvmmalloc.so.1:
ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
libpthread.so.0 (GLIBC_2.3.4) => /lib64/libpthread.so.0
libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so.0
libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so.0
libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
/lib64/libc.so.6:
ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
/lib64/libpthread.so.0:
ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
+ echo 0
0
+ dmesg
[12890.676033] traps: test_libvmmallo[15789] general protection ip:7f3f01481a31 sp:7ffd85f4b7a0 error:0 in libvmmalloc.so.1.0.0[7f3f0146d000+3e000]
+ set +x
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/xzhou/fsdax/test_libvmmalloc...done.
(gdb) b main
Breakpoint 1 at 0x40073c: file test_libvmmalloc.c, line 18.
(gdb) r
Starting program: /home/xzhou/fsdax/./test_libvmmalloc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Breakpoint 1, main (argc=1, argv=0x7fffffffe388) at test_libvmmalloc.c:18
18 char *buf = NULL;
(gdb) c
Continuing.
Testing /home/xzhou/fsdax/./test_libvmmalloc, alloc size 256
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bada31 in arena_purge () from /usr/local/lib64/libvmmalloc.so.1
(gdb) bt
#0 0x00007ffff7bada31 in arena_purge () from /usr/local/lib64/libvmmalloc.so.1
#1 0x00007ffff7badcca in arena_dalloc_bin_run () from /usr/local/lib64/libvmmalloc.so.1
#2 0x00007ffff7baf0e0 in je_vmem_je_arena_dalloc_bin_locked () from /usr/local/lib64/libvmmalloc.so.1
#3 0x00007ffff7bc6d31 in je_vmem_je_tcache_bin_flush_small () from /usr/local/lib64/libvmmalloc.so.1
#4 0x00007ffff7bc761e in je_vmem_je_tcache_destroy () from /usr/local/lib64/libvmmalloc.so.1
#5 0x00007ffff7bc7895 in je_vmem_je_tcache_thread_cleanup () from /usr/local/lib64/libvmmalloc.so.1
#6 0x00007ffff7b9dccc in jemalloc_destructor () from /usr/local/lib64/libvmmalloc.so.1
#7 0x00007ffff7deb18a in _dl_fini () at dl-fini.c:253
#8 0x00007ffff7805b19 in __run_exit_handlers (status=0, listp=0x7ffff7b926c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#9 0x00007ffff7805b67 in __GI_exit (status=<optimized out>) at exit.c:99
#10 0x00007ffff77ee38c in __libc_start_main (main=0x40072d <main>, argc=1, ubp_av=0x7fffffffe388, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe378) at ../csu/libc-start.c:308
#11 0x0000000000400669 in _start ()
(gdb) c
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) q
# cat nf.sh
#!/bin/bash
set xfs /dev/pmem0 /daxmnt
[ $# -ne 3 ] && { echo $0 fst dev mnt; exit 1; }
#yum install -y libvmmalloc-devel libvmmalloc libvmem-devel
#debuginfo-install glibc libgcc libvmmalloc
FSTYP=$1
DEV1=$2
MNT1=$3
mountpoint $MNT1 > /dev/null 2>&1 && umount $MNT1
mkdir -p $MNT1
if [ "$FSTYP" == "ext4" ] ; then
mkfs.ext4 -Fq -b 4096 $DEV1
elif [ "$FSTYP" == "xfs" ] ; then
mkfs.xfs -fq -b size=4096 $DEV1
fi
mount -o dax $DEV1 $MNT1
cat > /dev/null <<EOF
for psize in 20 21 25 30 31 32 ; do
for asize in 3 8 13 21 31 32; do
cc test_libvmmalloc.c -DALLOC_SIZE="((size_t)(1UL << $asize))" -o test_libvmmalloc -lvmmalloc
if [ $? -ne 0 ] ; then
echo "nvml libvmmalloc $asize cc FAIL"
exit 1
fi
((pshift=1<<psize))
echo -ne "\t$psize $asize"
VMMALLOC_POOL_DIR=$MNT1/ VMMALLOC_POOL_SIZE=$pshift ./test_libvmmalloc && \
VMMALLOC_POOL_DIR=$MNT1/ VMMALLOC_POOL_SIZE=$pshift ls > /dev/null $MNT1
done
done
EOF
psize=30
asize=8
((pshift=1<<psize))
dmesg -C
set -x
cc -ggdb test_libvmmalloc.c -DALLOC_SIZE="((size_t)(1UL << $asize))" -o test_libvmmalloc -lvmmalloc || exit
VMMALLOC_POOL_DIR=$MNT1/ VMMALLOC_POOL_SIZE=$pshift ./test_libvmmalloc
ldd -v ./test_libvmmalloc
echo $?
dmesg
set +x
VMMALLOC_POOL_DIR=$MNT1/ VMMALLOC_POOL_SIZE=$pshift gdb ./test_libvmmalloc
umount $MNT1 $DEV1 > /dev/null 2>&1
# cat test_libvmmalloc.c
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libvmem.h>
/* alloc size -- 1 KB */
#ifndef ALLOC_SIZE
#define ALLOC_SIZE ((size_t)(1 << 10))
#endif
int main(int argc, char *argv[])
{
char *path;
char *ptr;
char *buf = NULL;
printf("\tTesting %s, alloc size %lu\n", argv[0], ALLOC_SIZE);
if ((ptr = malloc(ALLOC_SIZE)) == NULL) {
perror("vmem_malloc");
exit(1);
}
buf = (char *)malloc(ALLOC_SIZE);
if (buf == NULL) {
perror("a buf malloc");
free(ptr);
exit(1);
}
memset(buf, 'a', ALLOC_SIZE);
strncpy(ptr, buf, ALLOC_SIZE);
buf = (char *)realloc(buf, ALLOC_SIZE - 1);
if (buf == NULL) {
perror("b buf malloc");
free(ptr);
exit(1);
}
memset(buf, 'b', ALLOC_SIZE - 1);
strncpy(ptr, buf, ALLOC_SIZE - 1);
buf = (char *)realloc(buf, ALLOC_SIZE + 1024);
if (buf == NULL) {
perror("c buf malloc");
free(ptr);
exit(1);
}
memset(buf, 'c', ALLOC_SIZE + 1024);
strncpy(ptr, buf, ALLOC_SIZE + 1024);
/* give the memory back */
free(ptr);
free(buf);
return 0;
}
# git remote -v
origin https://github.com/pmem/nvml.git (fetch)
origin https://github.com/pmem/nvml.git (push)
# git log --oneline -1
2f9a347 Merge pull request #2576 from plebioda/bug-fixing
2 years, 11 months
[PATCH] ndctl: add options to update firmware manpage
by Dave Jiang
update firmware is missing the long/short option in the manpage. Adding
the missing sections.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
Documentation/ndctl/ndctl-update-firmware.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/Documentation/ndctl/ndctl-update-firmware.txt b/Documentation/ndctl/ndctl-update-firmware.txt
index d742302..dd90612 100644
--- a/Documentation/ndctl/ndctl-update-firmware.txt
+++ b/Documentation/ndctl/ndctl-update-firmware.txt
@@ -10,6 +10,23 @@ SYNOPSIS
[verse]
'ndctl update-firmware' -f <firmware_file> -d <dimm name>
+EXAMPLES
+--------
+
+Updating DIMM nmem0 with firmware file name firmwarefile.bin.
+[verse]
+ndctl update-firmware -f firmwarefile.bin -d nmem0
+
+OPTIONS
+-------
+-f::
+--firmware=::
+ The path and name of the firmware file to be updated.
+
+-d::
+--dimm=::
+ The DIMM name to be updated.
+
COPYRIGHT
---------
Copyright (c) 2016 - 2017, Intel Corporation. License GPLv2: GNU GPL
2 years, 11 months
[ndctl PATCH] ndctl, bash completion: add completion for update-firmware
by Vishal Verma
Add filename completion for --firmware. dimm completion is already in
place from other commands that use dimms.
Cc: Dave Jiang <dave.jiang(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
contrib/ndctl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/contrib/ndctl b/contrib/ndctl
index fb0d421..eeda1c4 100755
--- a/contrib/ndctl
+++ b/contrib/ndctl
@@ -91,7 +91,7 @@ __ndctlcomp()
COMPREPLY=( $( compgen -W "$1" -- "$2" ) )
for cword in "${COMPREPLY[@]}"; do
- if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count) ]]; then
+ if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count|--firmware) ]]; then
COMPREPLY[$i]="${cword}="
else
COMPREPLY[$i]="${cword} "
@@ -202,6 +202,8 @@ __ndctl_comp_options()
--output)
;&
--input)
+ ;&
+ --firmware)
__ndctl_file_comp "${cur##*=}"
return
;;
--
2.14.3
2 years, 11 months
[ndctl PATCH] ndctl, test: make btt-pad-compat dynamically detect a patched kernel
by Vishal Verma
The btt-pad-compat test can detect whether it is running on a patched
kernel by checking for the two newly added debugfs files in the fix for
this bug. Use that instead of hard coding a kernel version dependency.
Cc: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
test/btt-pad-compat.sh | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/test/btt-pad-compat.sh b/test/btt-pad-compat.sh
index d10efe3..faa773c 100755
--- a/test/btt-pad-compat.sh
+++ b/test/btt-pad-compat.sh
@@ -41,17 +41,6 @@ err()
exit "$rc"
}
-check_min_kver()
-{
- local ver="$1"
- : "${KVER:=$(uname -r)}"
-
- [ -n "$ver" ] || return 1
- [[ "$ver" == "$(echo -e "$ver\n$KVER" | sort -V | head -1)" ]]
-}
-
-check_min_kver "4.15" || { echo "kernel $KVER may not have btt padding compat fixes"; exit "$rc"; }
-
check_prereq()
{
if ! command -v "$1" >/dev/null; then
@@ -70,6 +59,10 @@ create()
[ $size -gt 0 ] || err "$LINENO" 2
bttdev=$(cat /sys/bus/nd/devices/$dev/holder)
[ -n "$bttdev" ] || err "$LINENO" 2
+ if [ ! -e /sys/kernel/debug/btt/$bttdev/arena0/log_index_0 ]; then
+ echo "kernel $(uname -r) seems to be missing the BTT compatibility fixes, skipping"
+ exit 77
+ fi
}
reset()
--
2.14.3
2 years, 11 months
[PATCH] acpi, nfit: fix register dimm error handling
by Toshi Kani
A NULL pointer reference kernel bug was observed when
acpi_nfit_add_dimm() called in acpi_nfit_register_dimms()
failed. This error path does not set nfit_mem->nvdimm, but
the 2nd list_for_each_entry() loop in the function assumes
it's always set. Add a check to nfit_mem->nvdimm.
Signed-off-by: Toshi Kani <toshi.kani(a)hpe.com>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: "Rafael J. Wysocki" <rjw(a)rjwysocki.net>
---
drivers/acpi/nfit/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index abeb4df4f22e..b28ce440a06f 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1867,6 +1867,9 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
struct kernfs_node *nfit_kernfs;
nvdimm = nfit_mem->nvdimm;
+ if (!nvdimm)
+ continue;
+
nfit_kernfs = sysfs_get_dirent(nvdimm_kobj(nvdimm)->sd, "nfit");
if (nfit_kernfs)
nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs,
2 years, 11 months
[ndctl PATCH] ndctl: fix leak of daxctl_region instances
by Dan Williams
The daxctl_region returned by ndctl_dax_get_daxctl_region() should be
automatically freed when its parent infrastructure is torn down.
Reported-by: Lukasz Plewa <lukasz.plewa(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/libndctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 4119a2e6b564..9314e8b8f81b 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -434,6 +434,7 @@ static void free_pfn(struct ndctl_pfn *pfn, struct list_head *head)
static void free_dax(struct ndctl_dax *dax, struct list_head *head)
{
+ daxctl_region_unref(dax->region);
__free_pfn(&dax->pfn, head, dax);
}
2 years, 11 months
[PATCH] libnvdimm, namespace: make min namespace size 4K
by Dan Williams
The arbitrary 4MB minimum namespace size turns out to be too large for
some environments. Quoting Cheng-mean Liu:
In the case of emulated NVDIMM devices in the VM environment, there
are scenarios that NVDIMM device with much smaller sizes are
desired, for example, we might use a single enumerated NVDIMM DAX
device for representing each container layer, which in some cases
could be just a few KBs size.
PAGE_SIZE is the minimum where we can still support DAX of at least
a single page.
Cc: Matthew Wilcox <willy(a)infradead.org>
Reported-by: Cheng-mean Liu <soccerl(a)microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
include/uapi/linux/ndctl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 30ef1236aafa..7e27070b9440 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -209,7 +209,7 @@ enum nd_driver_flags {
};
enum {
- ND_MIN_NAMESPACE_SIZE = 0x00400000,
+ ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
};
enum ars_masks {
2 years, 11 months