Skip to content

Commit c293498

Browse files
Stoyan Gaydarovchrismason-xx
authored andcommitted
Btrfs: BUG to BUG_ON changes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
1 parent 3e7ad38 commit c293498

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎fs/btrfs/ctree.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,8 +2157,7 @@ static int insert_ptr(struct btrfs_trans_handle *trans, struct btrfs_root
21572157
BUG_ON(!path->nodes[level]);
21582158
lower = path->nodes[level];
21592159
nritems = btrfs_header_nritems(lower);
2160-
if (slot > nritems)
2161-
BUG();
2160+
BUG_ON(slot > nritems);
21622161
if (nritems == BTRFS_NODEPTRS_PER_BLOCK(root))
21632162
BUG();
21642163
if (slot != nritems) {

‎fs/btrfs/free-space-cache.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
253253

254254
if (ret) {
255255
printk(KERN_ERR "btrfs: unable to add free space :%d\n", ret);
256-
if (ret == -EEXIST)
257-
BUG();
256+
BUG_ON(ret == -EEXIST);
258257
}
259258

260259
return ret;

‎fs/btrfs/tree-log.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
12221222
ret = insert_one_name(trans, root, path, key->objectid, key->offset,
12231223
name, name_len, log_type, &log_key);
12241224

1225-
if (ret && ret != -ENOENT)
1226-
BUG();
1225+
BUG_ON(ret && ret != -ENOENT);
12271226
goto out;
12281227
}
12291228

0 commit comments

Comments
 (0)