diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-02-08 10:01:01 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-02-15 10:40:23 -0500 |
commit | 8f24b49688281a77e8331894ed407f0cfe732303 (patch) | |
tree | 22d5c69f57713ee25a4a3e38404d675c488a91cf /fs | |
parent | 941b2ddf71987ef369389517a7e215dd505fe01e (diff) |
Btrfs: avoid positive number with ERR_PTR
inode_ref_info() returns 1 when the element wasn't found and < 0 on error,
just like btrfs_search_slot(). In iref_to_path() it's an error when the
inode ref can't be found, thus we return ERR_PTR(ret) in that case. In order
to avoid ERR_PTR(1), we now set ret to -ENOENT in that case.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/backref.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 633c701a287d..98f6bf10bbd4 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -892,6 +892,8 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, | |||
892 | if (eb != eb_in) | 892 | if (eb != eb_in) |
893 | free_extent_buffer(eb); | 893 | free_extent_buffer(eb); |
894 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); | 894 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); |
895 | if (ret > 0) | ||
896 | ret = -ENOENT; | ||
895 | if (ret) | 897 | if (ret) |
896 | break; | 898 | break; |
897 | next_inum = found_key.offset; | 899 | next_inum = found_key.offset; |