Skip to content

Commit

Permalink
fix: root inode should also have inodeinfo xattr
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 22, 2023
1 parent e3e95a0 commit ceec2e1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/dwarfs_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,16 @@ void op_getxattr(fuse_req_t req, fuse_ino_t ino, char const* name,
oss << "no performance monitor support\n";
#endif
}
} else {
if (name == inodeinfo_xattr) {
auto entry = userdata->fs.find(ino);
}

if (entry) {
auto ii = userdata->fs.get_inode_info(*entry);
oss << folly::toPrettyJson(ii) << "\n";
} else {
err = ENOENT;
}
if (name == inodeinfo_xattr) {
auto entry = userdata->fs.find(ino);

if (entry) {
auto ii = userdata->fs.get_inode_info(*entry);
oss << folly::toPrettyJson(ii) << "\n";
} else {
err = ENOENT;
}
}

Expand Down Expand Up @@ -899,10 +899,10 @@ void op_listxattr(fuse_req_t req, fuse_ino_t ino, size_t size) {
if (ino == FUSE_ROOT_ID) {
oss << pid_xattr << '\0';
oss << perfmon_xattr << '\0';
} else {
oss << inodeinfo_xattr << '\0';
}

oss << inodeinfo_xattr << '\0';

auto xattrs = oss.view();

LOG_TRACE << __func__ << ": xattrs.size=" << xattrs.size();
Expand Down

0 comments on commit ceec2e1

Please sign in to comment.