Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/fuse/FuseOps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,13 @@ void hf3fs_symlink(fuse_req_t req, const char *link, fuse_ino_t fparent, const c
ior->ioDepth,
*ior->iora);
if (!res2) {
handle_error(req, res);
handle_error(req, res2);
// rollback the successful addIov before returning
auto rmRes = d.iovs.rmIov(name, userInfo);
if (rmRes.hasError()) {
XLOGF(ERR, "failed to rollback iov after addIoRing failure: {}", rmRes.error());
}
return;
}
// record the ior index for later removal
res->second->iorIndex = *res2;
Comment on lines 1236 to 1246

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the addIoRing failure path, addIov has already inserted/mapped the SHM and added it to the IovTable. Returning immediately after handle_error leaves an orphaned iov (and its mapped SHM) even though the symlink operation fails, which can leak resources and eventually exhaust iov_limit().

Consider rolling back the successful addIov before returning (e.g., d.iovs.rmIov(name, userInfo) and any other related cleanup) so the system state matches the error returned to the client.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, please check again

Expand Down