mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-09 11:27:56 +00:00
btrfs-progs: handle orphan creation error in btrfs_unlink
The error handling is simple and just returns an error upward, no cleanup. Resolves-coverity-id: 1260251 Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
70607997ee
commit
fe283a4fc3
2
inode.c
2
inode.c
@ -350,6 +350,8 @@ int btrfs_unlink(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
/* For nlinks == 0, add it to orphan list if needed */
|
||||
if (nlinks == 0 && add_orphan) {
|
||||
ret = btrfs_add_orphan_item(trans, root, path, ino);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
btrfs_mark_buffer_dirty(path->nodes[0]);
|
||||
btrfs_release_path(path);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user