lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200722191026.GA583549@kroah.com>
Date:   Wed, 22 Jul 2020 21:10:26 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Jaegeuk Kim <jaegeuk@...nel.org>
Cc:     Daeho Jeong <daeho43@...il.com>, linux-kernel@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net, kernel-team@...roid.com,
        Daeho Jeong <daehojeong@...gle.com>
Subject: Re: [PATCH 1/2] f2fs: add sysfs symbolic link to kobject with volume
 name

On Wed, Jul 22, 2020 at 10:24:37AM -0700, Jaegeuk Kim wrote:
> On 07/22, Greg KH wrote:
> > On Wed, Jul 22, 2020 at 09:43:56AM -0700, Jaegeuk Kim wrote:
> > > On 07/19, Greg KH wrote:
> > > > On Sun, Jul 19, 2020 at 02:44:08PM +0900, Daeho Jeong wrote:
> > > > > From: Daeho Jeong <daehojeong@...gle.com>
> > > > > 
> > > > > Added a symbolic link directory pointing to its device name
> > > > > directory using the volume name of the partition in sysfs.
> > > > > (i.e., /sys/fs/f2fs/vol_#x -> /sys/fs/f2fs/sda1)
> > > > 
> > > > No, please no.
> > > > 
> > > > That is already created today for you in /dev/disk/  The kernel does not
> > > > need to do this again.
> > > > 
> > > > If your distro/system/whatever does not provide you with /dev/disk/ and
> > > > all of the symlinks in there, then work with your distro/system/whatever
> > > > to do so.
> > > 
> > > I don't get the point, since /dev/disk points device node, not any sysfs entry.
> > > Do you mean we need to create symlink to /sys/fs/f2fs/dm-X in /dev/disk?
> > 
> > Huh, no!  It's all done for you today automagically by userspace:
> > 
> > $ tree /dev/disk/by-label/
> > /dev/disk/by-label/
> > ├── boot -> ../../sda1
> > ├── fast_disk -> ../../md0
> > ├── root -> ../../sda2
> > └── stuff -> ../../dm-0
> > 
> > Look on your laptop/desktop/server today for those, there's lots of
> > symlinks in /dev/disk/
> 
> What I mean is "creating symlink from *userspace*", but the concern is
> "/dev/" looks like being used for device nodes only, not sysfs.

That is correct, that is what /dev/ is for, not sysfs.

> > > > Again, no need to do this on a per-filesystem-basis when we already have
> > > > this around for all filesystems, and have had it for 15+ years now.
> > > 
> > > Could you point out where we can get this? And, the label support depends
> > > on per-filesystem design. I'm not sure how this can be generic enough.
> > 
> > Userspace knows how to read labels on a per-filesystem-basis and does so
> > just fine.  That's how it creates those symlinks, no kernel support is
> > needed.
> > 
> > This has been implemented for 15+ years now, it's not a new thing...
> > 
> > Now if your embedded system doesn't support it, that's the userspace of
> > that system's fault, it's not the kernel's fault at all.  Go fix your
> > userspace if you want those things.
> 
> I'm not talking about whose fault tho. :) By any chance, could you please
> suggest a good location to create a symlink for this sysfs entry?

There is no need for such a sysfs entry, that's what I am trying to say.
Userspace already has all of the needed information here, do not try to
add filesystem-specific stuff like this, unless you somehow are going to
do it for all filesystems :)

thanks,

gregt k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ