]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: don't require nsfs to be mounted
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 3 Feb 2023 18:12:31 +0000 (18:12 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 4 Feb 2023 13:10:18 +0000 (13:10 +0000)
nsfs only gets mounted in fairly specific circumstances[0].

[0] https://unix.stackexchange.com/a/559723

Suggested-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/lsfd.c

index e6da1cb89733b255af64147456aa11e4fadfaa51..e422a8066b1ae5aede5ae1289c3e2b0eb2f1bd2f 100644 (file)
@@ -477,7 +477,6 @@ static void add_mnt_ns(ino_t id)
 
 static const struct file_class *stat2class(struct stat *sb)
 {
-       const char *fs;
        dev_t dev;
 
        assert(sb);
@@ -499,8 +498,7 @@ static const struct file_class *stat2class(struct stat *sb)
                if (major(dev) != 0)
                        return &file_class;
 
-               fs = get_nodev_filesystem(minor(dev));
-               if (fs && strcmp(fs, "nsfs") == 0)
+               if (is_nsfs_dev(dev))
                        return &nsfs_file_class;
 
                return &file_class;