From: Thomas Weißschuh Date: Fri, 3 Feb 2023 18:12:31 +0000 (+0000) Subject: lsfd: don't require nsfs to be mounted X-Git-Tag: v2.39-rc1~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f7b36bed75ca5f6bac5468176308162028a5a2f;p=thirdparty%2Futil-linux.git lsfd: don't require nsfs to be mounted nsfs only gets mounted in fairly specific circumstances[0]. [0] https://unix.stackexchange.com/a/559723 Suggested-by: Masatake YAMATO Signed-off-by: Thomas Weißschuh --- diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index e6da1cb897..e422a8066b 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -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;