aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-02-28 16:46:22 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-02-28 16:46:22 -0500
commit0f70abe2b39d19171d4133d2ffdf77fb9113106a (patch)
tree98e6b00b38579385e64c085be43c65ab66780772 /fs/btrfs/ctree.c
parentaa5d6bed255d7f8c655a8f10d760f4247bc8385c (diff)
Btrfs: more return code checking
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index be2be0272513..273239932255 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1087,7 +1087,9 @@ static int del_ptr(struct ctree_root *root, struct ctree_path *path, int level)
1087 break; 1087 break;
1088 } 1088 }
1089 level++; 1089 level++;
1090 free_extent(root, blocknr, 1); 1090 wret = free_extent(root, blocknr, 1);
1091 if (wret)
1092 ret = wret;
1091 if (!path->nodes[level]) 1093 if (!path->nodes[level])
1092 BUG(); 1094 BUG();
1093 } 1095 }
@@ -1136,7 +1138,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
1136 wret = del_ptr(root, path, 1); 1138 wret = del_ptr(root, path, 1);
1137 if (wret) 1139 if (wret)
1138 ret = wret; 1140 ret = wret;
1139 free_extent(root, leaf_buf->blocknr, 1); 1141 wret = free_extent(root, leaf_buf->blocknr, 1);
1142 if (wret)
1143 ret = wret;
1140 } 1144 }
1141 } else { 1145 } else {
1142 int used = leaf_space_used(leaf, 0, leaf->header.nritems); 1146 int used = leaf_space_used(leaf, 0, leaf->header.nritems);
@@ -1173,7 +1177,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
1173 if (wret) 1177 if (wret)
1174 ret = wret; 1178 ret = wret;
1175 tree_block_release(root, leaf_buf); 1179 tree_block_release(root, leaf_buf);
1176 free_extent(root, blocknr, 1); 1180 wret = free_extent(root, blocknr, 1);
1181 if (wret)
1182 ret = wret;
1177 } else { 1183 } else {
1178 tree_block_release(root, leaf_buf); 1184 tree_block_release(root, leaf_buf);
1179 } 1185 }
@@ -1184,7 +1190,8 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
1184 1190
1185/* 1191/*
1186 * walk up the tree as far as required to find the next leaf. 1192 * walk up the tree as far as required to find the next leaf.
1187 * returns 0 if it found something or -1 if there are no greater leaves. 1193 * returns 0 if it found something or 1 if there are no greater leaves.
1194 * returns < 0 on io errors.
1188 */ 1195 */
1189int next_leaf(struct ctree_root *root, struct ctree_path *path) 1196int next_leaf(struct ctree_root *root, struct ctree_path *path)
1190{ 1197{
@@ -1196,7 +1203,7 @@ int next_leaf(struct ctree_root *root, struct ctree_path *path)
1196 1203
1197 while(level < MAX_LEVEL) { 1204 while(level < MAX_LEVEL) {
1198 if (!path->nodes[level]) 1205 if (!path->nodes[level])
1199 return -1; 1206 return 1;
1200 slot = path->slots[level] + 1; 1207 slot = path->slots[level] + 1;
1201 c = path->nodes[level]; 1208 c = path->nodes[level];
1202 if (slot >= c->node.header.nritems) { 1209 if (slot >= c->node.header.nritems) {