diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-06 18:46:03 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-01-06 18:46:03 +0100 |
commit | fe283a4fc32e28c9f83d5e9faec4b8f8375daeb0 (patch) | |
tree | 773a4d172769f1cb0cfc1d8d6b6c9fa97b7d9ce7 | |
parent | 70607997eeb24017196602afec4f1f0693a57a74 (diff) | |
download | btrfs-progs-fe283a4fc32e28c9f83d5e9faec4b8f8375daeb0.tar.gz |
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>
-rw-r--r-- | inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); } |