diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-05-23 14:37:47 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-23 14:37:47 -0400 |
commit | d6c0cb379c5198487e4ac124728cbb2346d63b1f (patch) | |
tree | 167a97ac58c7a2fbf7c4e94b6abbfe1e03af014a /fs/btrfs/file-item.c | |
parent | 8e531cdfeb75269c6c5aae33651cca39707848da (diff) | |
parent | 1f78160ce1b1b8e657e2248118c4d91f881763f0 (diff) | |
download | linux-3.10-d6c0cb379c5198487e4ac124728cbb2346d63b1f.tar.gz linux-3.10-d6c0cb379c5198487e4ac124728cbb2346d63b1f.tar.bz2 linux-3.10-d6c0cb379c5198487e4ac124728cbb2346d63b1f.zip |
Merge branch 'cleanups_and_fixes' into inode_numbers
Conflicts:
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index b437cc790bf..90d4ee52cd4 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -502,7 +502,6 @@ static noinline int truncate_one_csum(struct btrfs_trans_handle *trans, u32 new_size = (bytenr - key->offset) >> blocksize_bits; new_size *= csum_size; ret = btrfs_truncate_item(trans, root, path, new_size, 1); - BUG_ON(ret); } else if (key->offset >= bytenr && csum_end > end_byte && end_byte > key->offset) { /* @@ -515,7 +514,6 @@ static noinline int truncate_one_csum(struct btrfs_trans_handle *trans, new_size *= csum_size; ret = btrfs_truncate_item(trans, root, path, new_size, 0); - BUG_ON(ret); key->offset = end_byte; ret = btrfs_set_item_key_safe(trans, root, path, key); @@ -558,10 +556,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, ret = btrfs_search_slot(trans, root, &key, path, -1, 1); if (ret > 0) { if (path->slots[0] == 0) - goto out; + break; path->slots[0]--; } else if (ret < 0) { - goto out; + break; } leaf = path->nodes[0]; @@ -586,7 +584,8 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, /* delete the entire item, it is inside our range */ if (key.offset >= bytenr && csum_end <= end_byte) { ret = btrfs_del_item(trans, root, path); - BUG_ON(ret); + if (ret) + goto out; if (key.offset == bytenr) break; } else if (key.offset < bytenr && csum_end > end_byte) { @@ -640,9 +639,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, } btrfs_release_path(path); } + ret = 0; out: btrfs_free_path(path); - return 0; + return ret; } int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, @@ -768,7 +768,6 @@ again: goto insert; ret = btrfs_extend_item(trans, root, path, diff); - BUG_ON(ret); goto csum; } |