From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: dan.j.williams@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: Re: [PATCH v5 2/4] mm/nvdimm: Add page size and struct page size to pfn superblock
Date: Sat, 10 Aug 2019 09:51:23 +0530 [thread overview]
Message-ID: <8736i9r6po.fsf@linux.ibm.com> (raw)
In-Reply-To: <20190809074520.27115-3-aneesh.kumar@linux.ibm.com>
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
case PFN_MODE_PMEM:
> @@ -475,6 +484,20 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
> align = 1UL << ilog2(offset);
> mode = le32_to_cpu(pfn_sb->mode);
>
> + if (le32_to_cpu(pfn_sb->page_size) != PAGE_SIZE) {
> + dev_err(&nd_pfn->dev,
> + "init failed, page size mismatch %d\n",
> + le32_to_cpu(pfn_sb->page_size));
> + return -EOPNOTSUPP;
> + }
> +
> + if (le16_to_cpu(pfn_sb->page_struct_size) < sizeof(struct page)) {
> + dev_err(&nd_pfn->dev,
> + "init failed, struct page size mismatch %d\n",
> + le16_to_cpu(pfn_sb->page_struct_size));
> + return -EOPNOTSUPP;
> + }
> +
We need this here?
>From 9885b2f9ed81a2438fc81507cfcdbdb1aeab756c Mon Sep 17 00:00:00 2001
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Date: Fri, 9 Aug 2019 22:10:08 +0530
Subject: [PATCH] nvdimm: check struct page size only if pfn node is PMEM
We should do the check only with PFN_MODE_PMEM. If we use
memory for backing vmemmap, we should be able to enable
the namespace even if struct page size change.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
drivers/nvdimm/pfn_devs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index f43d1baa6f33..f3e9a4b826da 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -509,7 +509,8 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
return -EOPNOTSUPP;
}
- if (le16_to_cpu(pfn_sb->page_struct_size) < sizeof(struct page)) {
+ if ((le16_to_cpu(pfn_sb->page_struct_size) < sizeof(struct page)) &&
+ (mode == PFN_MODE_PMEM)) {
dev_err(&nd_pfn->dev,
"init failed, struct page size mismatch %d\n",
le16_to_cpu(pfn_sb->page_struct_size));
--
2.21.0
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2019-08-10 4:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 7:45 [PATCH v5 0/4] Mark the namespace disabled on pfn superblock mismatch Aneesh Kumar K.V
2019-08-09 7:45 ` [PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success Aneesh Kumar K.V
2019-08-14 4:22 ` Dan Williams
2019-08-15 19:54 ` Dan Williams
2019-08-19 7:05 ` Aneesh Kumar K.V
2019-08-19 16:57 ` Dan Williams
2019-08-09 7:45 ` [PATCH v5 2/4] mm/nvdimm: Add page size and struct page size to pfn superblock Aneesh Kumar K.V
2019-08-10 4:21 ` Aneesh Kumar K.V [this message]
2019-08-14 21:06 ` Dan Williams
2019-08-09 7:45 ` [PATCH v5 3/4] mm/nvdimm: Use correct #defines instead of open coding Aneesh Kumar K.V
2019-08-15 21:05 ` Dan Williams
2019-08-19 7:11 ` Aneesh Kumar K.V
2019-08-19 9:30 ` Aneesh Kumar K.V
2019-08-19 20:33 ` Dan Williams
2019-08-09 7:45 ` [PATCH v5 4/4] mm/nvdimm: Pick the right alignment default when creating dax devices Aneesh Kumar K.V
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736i9r6po.fsf@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox