summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2012-05-29 11:10:13 +0200
committerJosef Bacik <josef@redhat.com>2012-05-30 16:23:41 +0200
commit018642a1f197887058e97291460b890d296e8953 (patch)
tree5fc77a516728d0281873dc19f66ef9ca9e92ae34 /fs/btrfs/ctree.c
parentBtrfs: read device stats on mount, write modified ones during commit (diff)
downloadlinux-018642a1f197887058e97291460b890d296e8953.tar.xz
linux-018642a1f197887058e97291460b890d296e8953.zip
Btrfs: return value of btrfs_read_buffer is checked correctly
btrfs_read_buffer() has the possibility of returning the error. Therefore, I add the code in which the return value of btrfs_read_buffer() is checked. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 26847999c649..99fcad631a21 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -739,7 +739,11 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
if (!cur)
return -EIO;
} else if (!uptodate) {
- btrfs_read_buffer(cur, gen);
+ err = btrfs_read_buffer(cur, gen);
+ if (err) {
+ free_extent_buffer(cur);
+ return err;
+ }
}
}
if (search_start == 0)