[PATCH] libnvdimm: fix blk free space accounting
by Dan Williams
Commit a1f3e4d6a0c3 "libnvdimm, region: update nd_region_available_dpa()
for multi-pmem support" reworked blk dpa (DIMM Physical Address)
accounting to comprehend multiple pmem namespace allocations aliasing
with a given blk-dpa range.
The following call trace is a result of failing to account for allocated
blk capacity.
WARNING: CPU: 1 PID: 2433 at tools/testing/nvdimm/../../../drivers/nvdimm/names
4 size_store+0x6f3/0x930 [libnvdimm]
nd_region region5: allocation underrun: 0x0 of 0x1000000 bytes
[..]
Call Trace:
dump_stack+0x86/0xc3
__warn+0xcb/0xf0
warn_slowpath_fmt+0x5f/0x80
size_store+0x6f3/0x930 [libnvdimm]
dev_attr_store+0x18/0x30
If a given blk-dpa allocation does not alias with any pmem ranges then
the full allocation should be accounted as busy space, not the size of
the current pmem contribution to the region.
Cc: <stable(a)vger.kernel.org>
Fixes: a1f3e4d6a0c3 ("libnvdimm, region: update nd_region_available_dpa() for multi-pmem support").
Reported-by: Dave Jiang <dave.jiang(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/nvdimm/dimm_devs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index 0eedc49e0d47..ba1143b1b2ca 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -510,10 +510,8 @@ static int blk_dpa_busy(struct device *dev, void *data)
&& info->res->end <= map_end) {
info->busy -= nd_mapping->start - info->res->start;
return 0;
- } else {
- info->busy -= nd_mapping->size;
- return 0;
}
+ return 0;
}
/**
3 years, 9 months
[ndctl PATCH v3 0/7] Add ndctl check-namespace
by Vishal Verma
Changes in v3:
- Move the addition of ccan/bitmap to its own patch(es) (Dan)
- Drop the changelog update from the spec (Dan)
- Fix the [verse] section in the documentation text for check-namespace (Dan)
- Unify all namespace_disable paths to perform checking for a mounted
filesystem (Dan)
- Change the logging to use util/log.h (Dan)
- Use BTT_START_OFFSET for the initial offset, and store it in bttc (Jeff, Dan)
- Fix a number of line > 80 chars (everything but strings) (Jeff)
- Fix short write error handling, add fsync (Jeff)
- Save system page size in bttc to avoid calling sysconf repeatedly (Jeff)
- In check_log_map(), loop through the entire log even in case of an error,
and if there was a saved error, fail. (Jeff)
- btt-check.sh: in the post repair test, validate that the data read back
is the same as what was written (Jeff)
- Stop playing games with pre-adding/subtracting the initial 4K offset (Jeff)
- btt_read_info doesn't need to use 'rc', return directly.
Changes in v2:
- Move checking functionality to a separate file (Dan, Jeff)
- Rename btt-structs.h to check.h (Dan)
- Don't provide a configure option for building the checker, always
build it in. (Dan, Jeff)
- Fix the Documentation example to also include disable-namespace (Linda)
- Update the description text to note the namespace needs to be disabled
before checking (Linda)
- Use util/size.h for sizes (Dan)
- Use --repair to do repairs instead of --dry-run to disable repairs (Dan)
- Fix btt_read_info short read error handling (Jeff)
- Simplify the map lookup/write routines (Jeff)
- Differentiate the use off BTT_PG_SIZE, sysconf(_SC_PAGESIZE), and SZ_4K
(for the fixed start offset) in the different places they're used (Jeff)
- Add the missing msync when copying over info2 (Jeff)
- Add unit tests to test the checker (Jeff)
- Add a missing error case check in do_xaction_namespace for check
- Add a --force option that allows running on an active namespace (Jeff)
- Add a bitmap test for checking all internal blocks are referenced exactly
once between the map and flog (Jeff)
- Remove unused #defines in check.h
- Add comments to explain what we do with raw_mode (Jeff)
- Add some sanity checking when parsing an arena's metadata (Jeff)
- Refactor some read-verify sequences into a helper that combines the two (Jeff)
- Additional bounds checking on the 'offset' in recover_first_sb attempt 3 (Jeff)
- Add a missing ACTION_DESTROY string in parse_namespace_options (Dan)
- Use uXX, and cpu_to_XX from ccan/endian (Dan)
- Move the fletcher64 Routing to util/ as it is shared by builtin-dimm.c (Dan)
- Open the raw block device only once with O_EXCL instead of every time on
read/write/mmap (Dan)
- Add a new 'inform' routing in util/usage.c, and use it for some non-critical
messages (Dan)
- Remove namespace_is_offline() from builtin-check.c. Instead, use
util_namespace_active() from util/json.c
- Add a missing return value check after info block restoration in
discover_arenas
Vishal Verma (7):
libndctl: add a ndctl_namespace_is_active helper
libndctl: add a ndctl_namespace_disable_safe() API
ccan: Add ccan/bitmap in preparation for the BTT checker
ccan/bitmap: fix a set of gcc warnings (with -Wshadow)
ndctl: move the fletcher64 routine to util/
ndctl: add a BTT check utility
ndctl, test: Add a unit test for the BTT checker
Documentation/Makefile.am | 1 +
Documentation/ndctl-check-namespace.txt | 64 +++
Documentation/ndctl.txt | 1 +
Makefile.am | 7 +-
builtin.h | 1 +
ccan/bitmap/LICENSE | 1 +
ccan/bitmap/bitmap.c | 125 ++++
ccan/bitmap/bitmap.h | 243 ++++++++
contrib/ndctl | 3 +
licenses/LGPL-2.1 | 508 ++++++++++++++++
ndctl.spec.in | 2 +-
ndctl/Makefile.am | 1 +
ndctl/builtin-check.c | 988 ++++++++++++++++++++++++++++++++
ndctl/builtin-dimm.c | 18 +-
ndctl/builtin-list.c | 2 +-
ndctl/builtin-xaction-namespace.c | 112 ++--
ndctl/check.h | 127 ++++
ndctl/lib/libndctl.c | 59 ++
ndctl/lib/libndctl.sym | 2 +
ndctl/libndctl.h.in | 3 +
ndctl/ndctl.c | 1 +
test/Makefile.am | 5 +-
test/btt-check.sh | 170 ++++++
util/fletcher.c | 23 +
util/fletcher.h | 8 +
util/json.c | 17 +-
util/json.h | 1 -
util/util.h | 8 +
28 files changed, 2423 insertions(+), 78 deletions(-)
create mode 100644 Documentation/ndctl-check-namespace.txt
create mode 120000 ccan/bitmap/LICENSE
create mode 100644 ccan/bitmap/bitmap.c
create mode 100644 ccan/bitmap/bitmap.h
create mode 100644 licenses/LGPL-2.1
create mode 100644 ndctl/builtin-check.c
create mode 100644 ndctl/check.h
create mode 100755 test/btt-check.sh
create mode 100644 util/fletcher.c
create mode 100644 util/fletcher.h
--
2.9.3
3 years, 9 months
Re:
by USPS Delivery
Hello,
Your item has arrived at Sat, 01 Apr 2017 06:31:34 +0100, but our courier
was not able to deliver the parcel.
Review the document that is attached to this e-mail!
Most sincerely.
Gertruda Hendry - USPS Mail Delivery Agent.
3 years, 9 months
Delivery problem, parcel USPS #604658633
by USPS Ground
Hello,
We can not deliver your parcel arrived at Sat, 01 Apr 2017 03:29:00 +0200.
Postal label is enclosed to this e-mail. Please check the attachment!
All the best.
Deneen Iliff - USPS Mail Delivery Clerk.
3 years, 9 months