GNU bug report logs - #21018
Support for "libnvdimm BLK" devices

Previous Next

Package: parted;

Reported by: Dan Williams <dan.j.williams <at> intel.com>

Date: Thu, 9 Jul 2015 17:05:02 UTC

Severity: normal

To reply to this bug, email your comments to 21018 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#21018; Package parted. (Thu, 09 Jul 2015 17:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dan Williams <dan.j.williams <at> intel.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Thu, 09 Jul 2015 17:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dan Williams <dan.j.williams <at> intel.com>
To: bug-parted <at> gnu.org
Subject: Support for "libnvdimm BLK" devices
Date: Thu, 9 Jul 2015 10:00:10 -0700
BLK mode devices emitted by the libnvdimm sub-system [1] have a "." in
their name.  When parted calls _probe_sys_block() it trips over this
fact and unconditionally re-writes the block device name.

                /* in /sys/block, '/'s are replaced with '!' or '.' */
                for (ptr = dev_name; *ptr != '\0'; ptr++) {
                        if (*ptr == '!' || *ptr == '.')
                                *ptr = '/';
                }

This is confirmed by strace where parted emits calls to

lstat("/dev/ndblk2", 0x7ffec6b33e50)    = -1 ENOENT (No such file or directory)
stat("/dev/ndblk2/0", 0x7ffec6b33dc0)   = -1 ENOENT (No such file or directory)

The original BLK device name is /dev/ndblk2.0.

This can be reproduced with a 4.2-rc1+ kernel and the nfit_test
module.  See the libndctl readme for instructions on getting the test
environment running [2].

[1]: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next

[2]: https://github.com/pmem/ndctl




Information forwarded to bug-parted <at> gnu.org:
bug#21018; Package parted. (Thu, 09 Jul 2015 21:54:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: bug-parted <at> gnu.org
Subject: Re: bug#21018: Support for "libnvdimm BLK" devices
Date: Thu, 9 Jul 2015 14:52:52 -0700
On Thu, Jul 09, 2015 at 10:00:10AM -0700, Dan Williams wrote:
> BLK mode devices emitted by the libnvdimm sub-system [1] have a "." in
> their name.  When parted calls _probe_sys_block() it trips over this
> fact and unconditionally re-writes the block device name.
> 
>                 /* in /sys/block, '/'s are replaced with '!' or '.' */
>                 for (ptr = dev_name; *ptr != '\0'; ptr++) {
>                         if (*ptr == '!' || *ptr == '.')
>                                 *ptr = '/';
>                 }
> 
> This is confirmed by strace where parted emits calls to
> 
> lstat("/dev/ndblk2", 0x7ffec6b33e50)    = -1 ENOENT (No such file or directory)
> stat("/dev/ndblk2/0", 0x7ffec6b33dc0)   = -1 ENOENT (No such file or directory)
> 
> The original BLK device name is /dev/ndblk2.0.
> 
> This can be reproduced with a 4.2-rc1+ kernel and the nfit_test
> module.  See the libndctl readme for instructions on getting the test
> environment running [2].
> 
> [1]: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next
> 
> [2]: https://github.com/pmem/ndctl

Thanks for the report. I think we can reduce this to just replacing '!',
as far as I can tell cciss is the only device that has subdirectories
and uses the ! in the name. Looking at the current kernel code it looks
like the substitution is done in drivers/base/core.c ->
device_get_devnode()

I'm no kernel expert though. What does everyone think about dropping the
'.'? Do you know of anything that this would break?

In blivet (our storage library which handles all the devices we've ever
seen) it only looks for ! so that's reassuring.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




Information forwarded to bug-parted <at> gnu.org:
bug#21018; Package parted. (Tue, 04 Aug 2015 05:25:03 GMT) Full text and rfc822 format available.

Message #11 received at 21018 <at> debbugs.gnu.org (full text, mbox):

From: Dan Williams <dan.j.williams <at> intel.com>
To: "Brian C. Lane" <bcl <at> redhat.com>
Cc: 21018 <at> debbugs.gnu.org
Subject: Re: bug#21018: Support for "libnvdimm BLK" devices
Date: Mon, 3 Aug 2015 22:24:32 -0700
On Thu, Jul 9, 2015 at 2:52 PM, Brian C. Lane <bcl <at> redhat.com> wrote:
> On Thu, Jul 09, 2015 at 10:00:10AM -0700, Dan Williams wrote:
>> BLK mode devices emitted by the libnvdimm sub-system [1] have a "." in
>> their name.  When parted calls _probe_sys_block() it trips over this
>> fact and unconditionally re-writes the block device name.
>>
>>                 /* in /sys/block, '/'s are replaced with '!' or '.' */
>>                 for (ptr = dev_name; *ptr != '\0'; ptr++) {
>>                         if (*ptr == '!' || *ptr == '.')
>>                                 *ptr = '/';
>>                 }
>>
>> This is confirmed by strace where parted emits calls to
>>
>> lstat("/dev/ndblk2", 0x7ffec6b33e50)    = -1 ENOENT (No such file or directory)
>> stat("/dev/ndblk2/0", 0x7ffec6b33dc0)   = -1 ENOENT (No such file or directory)
>>
>> The original BLK device name is /dev/ndblk2.0.
>>
>> This can be reproduced with a 4.2-rc1+ kernel and the nfit_test
>> module.  See the libndctl readme for instructions on getting the test
>> environment running [2].
>>
>> [1]: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next
>>
>> [2]: https://github.com/pmem/ndctl
>
> Thanks for the report. I think we can reduce this to just replacing '!',
> as far as I can tell cciss is the only device that has subdirectories
> and uses the ! in the name. Looking at the current kernel code it looks
> like the substitution is done in drivers/base/core.c ->
> device_get_devnode()
>
> I'm no kernel expert though. What does everyone think about dropping the
> '.'? Do you know of anything that this would break?
>
> In blivet (our storage library which handles all the devices we've ever
> seen) it only looks for ! so that's reassuring.
>

Any update on this?

With this one line change, parted can list libnvdimm "BLK" devices:

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 27bbb8043e4f..2719ac327236 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2237,7 +2237,7 @@ _probe_sys_block ()
                strcat (dev_name, dirent->d_name);
                /* in /sys/block, '/'s are replaced with '!' or '.' */
                for (ptr = dev_name; *ptr != '\0'; ptr++) {
-                       if (*ptr == '!' || *ptr == '.')
+                       if (*ptr == '!')
                                *ptr = '/';
                }
                _ped_device_probe (dev_name);




Information forwarded to bug-parted <at> gnu.org:
bug#21018; Package parted. (Fri, 07 Aug 2015 17:11:01 GMT) Full text and rfc822 format available.

Message #14 received at 21018 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Dan Williams <dan.j.williams <at> intel.com>
Cc: 21018 <at> debbugs.gnu.org
Subject: Re: bug#21018: Support for "libnvdimm BLK" devices
Date: Fri, 7 Aug 2015 10:10:44 -0700
On Mon, Aug 03, 2015 at 10:24:32PM -0700, Dan Williams wrote:
> On Thu, Jul 9, 2015 at 2:52 PM, Brian C. Lane <bcl <at> redhat.com> wrote:
> > On Thu, Jul 09, 2015 at 10:00:10AM -0700, Dan Williams wrote:
> >> BLK mode devices emitted by the libnvdimm sub-system [1] have a "." in
> >> their name.  When parted calls _probe_sys_block() it trips over this
> >> fact and unconditionally re-writes the block device name.
> >>
> >>                 /* in /sys/block, '/'s are replaced with '!' or '.' */
> >>                 for (ptr = dev_name; *ptr != '\0'; ptr++) {
> >>                         if (*ptr == '!' || *ptr == '.')
> >>                                 *ptr = '/';
> >>                 }
> >>
> >> This is confirmed by strace where parted emits calls to
> >>
> >> lstat("/dev/ndblk2", 0x7ffec6b33e50)    = -1 ENOENT (No such file or directory)
> >> stat("/dev/ndblk2/0", 0x7ffec6b33dc0)   = -1 ENOENT (No such file or directory)
> >>
> >> The original BLK device name is /dev/ndblk2.0.
> >>
> >> This can be reproduced with a 4.2-rc1+ kernel and the nfit_test
> >> module.  See the libndctl readme for instructions on getting the test
> >> environment running [2].
> >>
> >> [1]: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next
> >>
> >> [2]: https://github.com/pmem/ndctl
> >
> > Thanks for the report. I think we can reduce this to just replacing '!',
> > as far as I can tell cciss is the only device that has subdirectories
> > and uses the ! in the name. Looking at the current kernel code it looks
> > like the substitution is done in drivers/base/core.c ->
> > device_get_devnode()
> >
> > I'm no kernel expert though. What does everyone think about dropping the
> > '.'? Do you know of anything that this would break?
> >
> > In blivet (our storage library which handles all the devices we've ever
> > seen) it only looks for ! so that's reassuring.
> >
> 
> Any update on this?
> 
> With this one line change, parted can list libnvdimm "BLK" devices:
> 
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index 27bbb8043e4f..2719ac327236 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -2237,7 +2237,7 @@ _probe_sys_block ()
>                 strcat (dev_name, dirent->d_name);
>                 /* in /sys/block, '/'s are replaced with '!' or '.' */
>                 for (ptr = dev_name; *ptr != '\0'; ptr++) {
> -                       if (*ptr == '!' || *ptr == '.')
> +                       if (*ptr == '!')
>                                 *ptr = '/';
>                 }
>                 _ped_device_probe (dev_name);

I think this is fine. I'll push it later today. Thanks!

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




This bug report was last modified 9 years and 319 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.