Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-08-21 14:25:48 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-08-21 14:25:48 +0200
commite7033078aca157d5b27ab4eb88e1b96e22ef187e (patch)
treea859d7e37b97d4f083a9f482f2fb6b028195c3d3
parent1af9ac2fb707d26e93aefa8eb406b1c13a398538 (diff)
libnvdimm/pfn: Store correct value of npfns in namespace
superblock (bsc#1146381 ltc#180720).
-rw-r--r--patches.suse/libnvdimm-pfn-Store-correct-value-of-npfns-in-namespace.patch47
-rw-r--r--series.conf1
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.suse/libnvdimm-pfn-Store-correct-value-of-npfns-in-namespace.patch b/patches.suse/libnvdimm-pfn-Store-correct-value-of-npfns-in-namespace.patch
new file mode 100644
index 0000000000..9cb05b457c
--- /dev/null
+++ b/patches.suse/libnvdimm-pfn-Store-correct-value-of-npfns-in-namespace.patch
@@ -0,0 +1,47 @@
+From b1092ec9fe1c5f6e8cadb2ee54fc010052e5cd06 Mon Sep 17 00:00:00 2001
+From: root <you@example.com>
+Date: Tue, 20 Aug 2019 03:09:58 -0400
+Subject: [PATCH] libnvdimm/pfn: Store correct value of npfns in namespace
+ superblock
+
+References: bsc#1146381 ltc#180720
+Patch-mainline: no, stable-only
+
+Commit a3619190d62e ("libnvdimm/pfn: stop padding pmem namespaces to
+section alignment") fixed an issue with nd_pfn_init() where the count
+of number of PFNs stored in pfn superblock was calculated assuming
+PAGE_SIZE == SZ_4K.
+
+Without the fix a wrong comparison happens in __nvdimm_setup_pfn()
+between recaulcaulted value of nd_pfn->npfns against one stored in
+superblock via nd_pfn->pfn_sb->npfns. This causes a warning to be
+issued of the form:
+
+ dax_pmem dax1.0: number of pfns truncated from 2093056 to 130816
+
+This warning is harmless but may confuse the user. Hence this patch
+picks the relavent hunk from commit a3619190d62e ("libnvdimm/pfn: stop
+padding pmem namespaces to section alignment") that fixes this issue.
+
+Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ 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 6a2685e8fbc6..c22462a277b6 100644
+--- a/drivers/nvdimm/pfn_devs.c
++++ b/drivers/nvdimm/pfn_devs.c
+@@ -757,7 +757,7 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
+ return -ENXIO;
+ }
+
+- npfns = (size - offset - start_pad - end_trunc) / SZ_4K;
++ npfns = PHYS_PFN(size - offset - start_pad - end_trunc);
+ pfn_sb->mode = cpu_to_le32(nd_pfn->mode);
+ pfn_sb->dataoff = cpu_to_le64(offset);
+ pfn_sb->npfns = cpu_to_le64(npfns);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 6a90cea28e..11fce08a0e 100644
--- a/series.conf
+++ b/series.conf
@@ -23634,6 +23634,7 @@
########################################################
# general lib/ optimizations
########################################################
+ patches.suse/libnvdimm-pfn-Store-correct-value-of-npfns-in-namespace.patch
########################################################
# CPUFREQ