From: Thomas Weißschuh Date: Wed, 28 Dec 2022 01:41:42 +0000 (+0000) Subject: lib/sysfs: allow parent redirect even for non-queue files X-Git-Tag: v2.39-rc1~349^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e374978e6beb03b475f3ced757ab3a144d416373;p=thirdparty%2Futil-linux.git lib/sysfs: allow parent redirect even for non-queue files We will also need this redirect for other sysfs files. --- diff --git a/lib/sysfs.c b/lib/sysfs.c index 56eea5c645..4dfa54fa98 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -155,8 +155,8 @@ struct path_cxt *sysfs_blkdev_get_parent(struct path_cxt *pc) } /* - * Redirects ENOENT errors to the parent, if the path is to the queue/ - * sysfs directory. For example + * Redirects ENOENT errors to the parent. + * For example * * /sys/dev/block/8:1/queue/logical_block_size redirects to * /sys/dev/block/8:0/queue/logical_block_size @@ -165,7 +165,7 @@ static int sysfs_blkdev_enoent_redirect(struct path_cxt *pc, const char *path, i { struct sysfs_blkdev *blk = ul_path_get_dialect(pc); - if (blk && blk->parent && path && strncmp(path, "queue/", 6) == 0) { + if (blk && blk->parent && path) { *dirfd = ul_path_get_dirfd(blk->parent); if (*dirfd >= 0) { DBG(CXT, ul_debugobj(pc, "%s redirected to parent", path));