Re: [PATCH] libnvdimm/pmem: Delete include of nd-core.h

2019-11-01 Thread Verma, Vishal L
On Thu, 2019-10-31 at 17:31 -0700, Dan Williams wrote:
> The entire point of nd-core.h is to hide functionality that no leaf
> driver should touch. In fact, the commit that added it had no need to
> include it.
> 
> Fixes: 06e8ccdab15f ("acpi: nfit: Add support for detect platform...")
> Cc: Ira Weiny 
> Cc: Dave Jiang 
> Cc: Vishal Verma 
> Signed-off-by: Dan Williams 
> ---
>  drivers/nvdimm/pmem.c |1 -
>  1 file changed, 1 deletion(-)

Looks good,
Reviewed-by: Vishal Verma 

> 
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index 7a6f4501dcda..ad8e4df1282b 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -28,7 +28,6 @@
>  #include "pmem.h"
>  #include "pfn.h"
>  #include "nd.h"
> -#include "nd-core.h"
>  
>  static struct device *to_dev(struct pmem_device *pmem)
>  {
> 

___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


[ndctl PATCH 1/2] ndctl/namespace: remove open coded is_namespace_active()

2019-11-01 Thread Vishal Verma
Remove the open coded namespace active check with the one provided by
libndctl - ndctl_namespace_is_active().

is_namespace_active() additionally checked for a non-NULL 'ndns', which
the libndctl API doesn't do. However, all the callers either performed
that check themselves, or made prior assumptions about ndns being valid
by dereferencing it earlier.

Cc: Dan Williams 
Signed-off-by: Vishal Verma 
---
 ndctl/namespace.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 7fb0007..ccd46d0 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -453,14 +453,6 @@ static int setup_namespace(struct ndctl_region *region,
return rc;
 }
 
-static int is_namespace_active(struct ndctl_namespace *ndns)
-{
-   return ndns && (ndctl_namespace_is_enabled(ndns)
-   || ndctl_namespace_get_pfn(ndns)
-   || ndctl_namespace_get_dax(ndns)
-   || ndctl_namespace_get_btt(ndns));
-}
-
 /*
  * validate_namespace_options - init parameters for setup_namespace
  * @region: parent of the namespace to create / reconfigure
@@ -787,7 +779,7 @@ static struct ndctl_namespace *region_get_namespace(struct 
ndctl_region *region)
/* prefer the 0th namespace if it is idle */
ndctl_namespace_foreach(region, ndns)
if (ndctl_namespace_get_id(ndns) == 0
-   && !is_namespace_active(ndns))
+   && !ndctl_namespace_is_active(ndns))
return ndns;
return ndctl_region_get_namespace_seed(region);
 }
@@ -827,7 +819,7 @@ static int namespace_create(struct ndctl_region *region)
p.size = available;
 
ndns = region_get_namespace(region);
-   if (!ndns || is_namespace_active(ndns)) {
+   if (!ndns || ndctl_namespace_is_active(ndns)) {
debug("%s: no %s namespace seed\n", devname,
ndns ? "idle" : "available");
return -EAGAIN;
@@ -1074,7 +1066,7 @@ static int namespace_reconfig(struct ndctl_region *region,
}
 
ndns = region_get_namespace(region);
-   if (!ndns || is_namespace_active(ndns)) {
+   if (!ndns || !ndctl_namespace_is_active(ndns)) {
debug("%s: no %s namespace seed\n",
ndctl_region_get_devname(region),
ndns ? "idle" : "available");
-- 
2.20.1
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


[ndctl PATCH 2/2] ndctl/namespace: introduce ndctl_namespace_is_configurable()

2019-11-01 Thread Vishal Verma
The motivation for this change is that we want to refrain from
(re)configuring what appear to be partially configured namespaces.
Namespaces may end up in a state that looks partially configured when
the kernel isn't able to enable a namespace due to mismatched
PAGE_SIZE expectations. In such cases, ndctl should not treat those
as unconfigured 'seed' namespaces, and reuse them.

Add a new ndctl_namespace_is_configurable API, whish tests whether a
namespaces is active, and whether it is partially configured. If neither
are true, then it can be used for (re)configuration. Additionally, deal
with the corner case of ND_DEVICE_NAMESPACE_IO (legacy PMEM) namespaces
by testing whether the size attribute is read-only (which indicates such
a namespace). Legacy namespaces always appear as configured, since their
size cannot be changed, but they are also always re-configurable.

Use this API in namespace_reconfig() and namespace_create() to enable
this partial configuration detection.

Cc: Dan Williams 
Reported-by: Aneesh Kumar K.V 
Signed-off-by: Vishal Verma 
---

Hi Aneesh - could you please test these patches and see if they work for
the pfn_sb PAGE_SIZE mismatch scenario?

 ndctl/lib/libndctl.c   | 37 +
 ndctl/lib/libndctl.sym |  4 
 ndctl/libndctl.h   |  1 +
 ndctl/namespace.c  |  6 +++---
 util/sysfs.c   | 18 ++
 util/sysfs.h   |  3 +++
 6 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 6596f94..1674cf9 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -3985,6 +3985,21 @@ static void region_refresh_children(struct ndctl_region 
*region)
daxs_init(region);
 }
 
+static bool namespace_size_is_writeable(struct ndctl_namespace *ndns)
+{
+   struct ndctl_ctx *ctx = ndctl_namespace_get_ctx(ndns);
+   char *path = ndns->ndns_buf;
+   int len = ndns->buf_len;
+
+   if (snprintf(path, len, "%s/size", ndns->ndns_path) >= len) {
+   err(ctx, "%s: buffer too small!\n",
+   ndctl_namespace_get_devname(ndns));
+   return false;
+   }
+
+   return sysfs_attr_writable(ctx, path);
+}
+
 NDCTL_EXPORT bool ndctl_namespace_is_active(struct ndctl_namespace *ndns)
 {
struct ndctl_btt *btt = ndctl_namespace_get_btt(ndns);
@@ -4182,6 +4197,28 @@ NDCTL_EXPORT int ndctl_namespace_is_configured(struct 
ndctl_namespace *ndns)
}
 }
 
+/*
+ * Check if a given 'seed' namespace is ok to configure.
+ * If a size or uuid is present, it is considered not configurable, except
+ * in the case of legacy (ND_DEVICE_NAMESPACE_IO) namespaces. In that case,
+ * the size is never zero, but the namespace can still be reconfigured.
+ * Detect this by testing whether the size is writable. If it is not writable,
+ * then it is ok to (re)configure. In other words, legacy namespaces are always
+ * 'configured', but they are also always 'configurable'.
+ */
+NDCTL_EXPORT int ndctl_namespace_is_configurable(struct ndctl_namespace *ndns)
+{
+   if (ndctl_namespace_is_active(ndns))
+   return 0;
+   if (ndctl_namespace_is_configured(ndns)) {
+   if (!namespace_size_is_writeable(ndns))
+   return 1;
+   return 0;
+   }
+   /* !active and !configured is configurable */
+   return 1;
+}
+
 NDCTL_EXPORT void ndctl_namespace_get_uuid(struct ndctl_namespace *ndns, 
uuid_t uu)
 {
memcpy(uu, ndns->uuid, sizeof(uuid_t));
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index c93c1ee..835d36b 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -423,3 +423,7 @@ LIBNDCTL_21 {
 LIBNDCTL_22 {
ndctl_dimm_security_is_frozen;
 } LIBNDCTL_21;
+
+LIBNDCTL_23 {
+   ndctl_namespace_is_configurable;
+} LIBNDCTL_22;
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index db398b3..e4dd22f 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -491,6 +491,7 @@ int ndctl_namespace_disable_safe(struct ndctl_namespace 
*ndns);
 bool ndctl_namespace_is_active(struct ndctl_namespace *ndns);
 int ndctl_namespace_is_valid(struct ndctl_namespace *ndns);
 int ndctl_namespace_is_configured(struct ndctl_namespace *ndns);
+int ndctl_namespace_is_configurable(struct ndctl_namespace *ndns);
 int ndctl_namespace_delete(struct ndctl_namespace *ndns);
 int ndctl_namespace_set_uuid(struct ndctl_namespace *ndns, uuid_t uu);
 void ndctl_namespace_get_uuid(struct ndctl_namespace *ndns, uuid_t uu);
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index ccd46d0..2979e78 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -779,7 +779,7 @@ static struct ndctl_namespace *region_get_namespace(struct 
ndctl_region *region)
/* prefer the 0th namespace if it is idle */
ndctl_namespace_foreach(region, ndns)
if (ndctl_namespace_get_id(ndns) == 0
-   && 

Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers

2019-11-01 Thread Jeff Moyer
Masahiro Yamada  writes:

> On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer  wrote:
>>
>> Masahiro Yamada  writes:
>>
>> > Now that there is no overwrap between symbols from ELF files and
>> > ones from Module.symvers.
>> >
>> > So, the 'exported twice' warning should be reported irrespective
>> > of where the symbol in question came from. Only the exceptional case
>> > is when __crc_ symbol appears before __ksymtab_. This
>> > typically occurs for EXPORT_SYMBOL in .S files.
>>
>> Hi, Masahiro,
>>
>> After apply this patch, I get the following modpost warnings when doing:
>>
>> $ make M=tools/tesing/nvdimm
>> ...
>>   Building modules, stage 2.
>>   MODPOST 12 modules
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported
>> twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. 
>> Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. 
>> Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> ...
>>
>> There are a lot of these warnings.  :)
>
> These warnings are correct since
> drivers/nvdimm/Makefile and
> tools/testing/nvdimm/Kbuild
> compile the same files.

Yeah, but that's by design.  Is there a way to silence these warnings?

-Jeff
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


Contact Money Gram international service-Benin to receive your payment funds US$2.500,000 Million

2019-11-01 Thread Mary Coster, I.M.F director-Benin
Attn Dear,Funds Beneficiary.
Contact Money Gram international service-Benin to receive your payment
funds US$2.500,000 Million approved this morning through the UN
payment settlement organization.
Contact Person, Mr. John Dave.
Official Director.Money Gram-Benin
Email: moneygram.1...@outlook.fr
Telephone +229 62619517
Once you get intouch with Mr. John Dave, Money Gram Director, send to
him your address including your phone numbers. He will be sending the
transfer to you  $5000.00 USD daily until you received your complete
payment $2.5m from the office.
Note,I have paid the whole service fees for you but only small money
you been required to send to this office is $23.00 only via Money Gram
transfer.
God bless
Mary Coster, I.M.F director-Benin
m.cos...@aol.com
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org