From 56fd97e62eb73d0bfe59838f62799d51a9c9a3bf Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Wed, 2 Oct 2024 10:50:36 +0200 Subject: [PATCH] lxcfs: fix readdir for procfs subtree After #640 was merged we've got the entire procfs subtree unavailable. Fixes: #640 Signed-off-by: Alexander Mikhalitsyn --- src/lxcfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxcfs.c b/src/lxcfs.c index b14d7330..c5eef200 100644 --- a/src/lxcfs.c +++ b/src/lxcfs.c @@ -747,7 +747,7 @@ static int lxcfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, { int ret; enum lxcfs_virt_t type; - + type = file_info_type(fi); if (strcmp(path, "/") == 0) { @@ -768,7 +768,7 @@ static int lxcfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, return ret; } - if (LXCFS_TYPE_PROC(type)) { + if (strcmp(path, "/proc") == 0) { up_users(); ret = do_proc_readdir(path, buf, filler, offset, fi); down_users(); @@ -883,7 +883,7 @@ static int lxcfs_read(const char *path, char *buf, size_t size, off_t offset, { int ret; enum lxcfs_virt_t type; - + type = file_info_type(fi); if (cgroup_is_enabled && LXCFS_TYPE_CGROUP(type)) { @@ -908,7 +908,7 @@ static int lxcfs_read(const char *path, char *buf, size_t size, off_t offset, } lxcfs_error("unknown file type: path=%s, type=%d, fi->fh=%" PRIu64, - path, type, fi->fh); + path, type, fi->fh); return -EINVAL; } @@ -918,7 +918,7 @@ int lxcfs_write(const char *path, const char *buf, size_t size, off_t offset, { int ret; enum lxcfs_virt_t type; - + type = file_info_type(fi); if (cgroup_is_enabled && LXCFS_TYPE_CGROUP(type)) {