Patch "libnvdimm, dax: record the specified alignment of a dax-device instance" has been added to the 4.6-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
libnvdimm, dax: record the specified alignment of a dax-device instance
to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
libnvdimm-dax-record-the-specified-alignment-of-a-dax-device-instance.patch
and it can be found in the queue-4.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
45a0dac0451136fa7ae34a6fea53ef6a136287ceMon Sep 17 00:00:00 2001
From: Dan Williams <[email protected]>
Date: Thu, 31 Mar 2016 15:41:18 -0700
Subject: libnvdimm, dax: record the specified alignment of a dax-device instance
From: Dan Williams <[email protected]>
commit 45a0dac0451136fa7ae34a6fea53ef6a136287ce upstream.
We want to use the alignment as the allocation and mapping unit. Previously this information was only useful for establishing the data offset, but now it is important to remember the granularity for the later use.
--- drivers/nvdimm/pfn.h | 4 +++- drivers/nvdimm/pfn_devs.c | 5 ++++- drivers/nvdimm/pmem.c | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-)
drivers/nvdimm/pfn.h +3 -1
@@ -33,7 +33,9 @@ struct nd_pfn_sb {/* minor-version-1 additions for section alignment */ __le32 start_pad;__le32 end_trunc; -u8 padding[4004 ]; +/* minor-version-2 record the base alignment of the mapping */ +__le32 align; +u8 padding[4000 ];__le64 checksum; };
drivers/nvdimm/pfn_devs.c +4 -1
@@ -360,6 +360,9 @@ int nd_pfn_validate(struct nd_pfn *nd_pf pfn_sb->end_trunc =0 ; } +if (__le16_to_cpu (pfn_sb->version_minor) <2 ) + pfn_sb->align =0 ; +switch (le32_to_cpu (pfn_sb->mode)) {case PFN_MODE_RAM :case PFN_MODE_PMEM :
@@ -399,7 +402,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfreturn -EBUSY ; } - nd_pfn->align =1UL <<ilog2 (offset); + nd_pfn->align =le32_to_cpu (pfn_sb->align);if (!is_power_of_2 (offset) || offset <PAGE_SIZE ) {dev_err (&nd_pfn->dev,"bad offset: %#llx dax disabled\n" , offset);
drivers/nvdimm/pmem.c +2 -1
@@ -426,9 +426,10 @@ static int nd_pfn_init(struct nd_pfn *ndmemcpy (pfn_sb->uuid, nd_pfn->uuid,16 );memcpy (pfn_sb->parent_uuid,nd_dev_to_uuid (&ndns->dev),16 ); pfn_sb->version_major =cpu_to_le16 (1 ); - pfn_sb->version_minor =cpu_to_le16 (1 ); + pfn_sb->version_minor =cpu_to_le16 (2 ); pfn_sb->start_pad =cpu_to_le32 (start_pad); pfn_sb->end_trunc =cpu_to_le32 (end_trunc); + pfn_sb->align =cpu_to_le32 (nd_pfn->align); checksum =nd_sb_checksum ((struct nd_gen_sb *) pfn_sb); pfn_sb->checksum =cpu_to_le64 (checksum);
Patches currently in stable-queue which might be from [email protected] are
queue-4.6/libnvdimm-pfn-dax-fix-initialization-vs-autodetect-for-mode-alignment.patch queue-4.6/libnvdimm-dax-record-the-specified-alignment-of-a-dax-device-instance.patch