]> git.baikalelectronics.ru Git - kernel.git/commit
device-dax: fix sysfs duplicate warnings
authorDan Williams <dan.j.williams@intel.com>
Wed, 19 Jul 2017 00:49:14 +0000 (17:49 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 19 Jul 2017 00:49:14 +0000 (17:49 -0700)
commit55d51e4d945248d4d6aba979ed8379fd70521c96
tree2f946ec4b9af0380e9949f57f41ccf347e31f782
parent378561eb072f653b3e8f554ee9722e666cea34ff
device-dax: fix sysfs duplicate warnings

Fix warnings of the form...

     WARNING: CPU: 10 PID: 4983 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80
     sysfs: cannot create duplicate filename '/class/dax/dax12.0'
     Call Trace:
      dump_stack+0x63/0x86
      __warn+0xcb/0xf0
      warn_slowpath_fmt+0x5a/0x80
      ? kernfs_path_from_node+0x4f/0x60
      sysfs_warn_dup+0x62/0x80
      sysfs_do_create_link_sd.isra.2+0x97/0xb0
      sysfs_create_link+0x25/0x40
      device_add+0x266/0x630
      devm_create_dax_dev+0x2cf/0x340 [dax]
      dax_pmem_probe+0x1f5/0x26e [dax_pmem]
      nvdimm_bus_probe+0x71/0x120

...by reusing the namespace id for the device-dax instance name.

Now that we have decided that there will never by more than one
device-dax instance per libnvdimm-namespace parent device [1], we can
directly reuse the namepace ids. There are some possible follow-on
cleanups, but those are saved for a later patch to simplify the -stable
backport.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2016-December/008266.html

Fixes: afabf8368c65 ("libnvdimm, namespace: allow creation of multiple pmem...")
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: <stable@vger.kernel.org>
Reported-by: Dariusz Dokupil <dariusz.dokupil@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dax/device-dax.h
drivers/dax/device.c
drivers/dax/pmem.c