Skip to content

Commit

Permalink
lxcfs: fix readdir for procfs subtree
Browse files Browse the repository at this point in the history
After lxc#640 was merged we've got the entire
procfs subtree unavailable.

Fixes: lxc#640
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
  • Loading branch information
mihalicyn committed Oct 2, 2024
1 parent 68fa858 commit 56fd97e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lxcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
}
Expand All @@ -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)) {
Expand Down

0 comments on commit 56fd97e

Please sign in to comment.