search for: drop_one_dir_item

Displaying 4 results from an estimated 4 matches for "drop_one_dir_item".

2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...} } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { /* inline extents are easy, we just overwrite them */ ret = overwrite_item(trans, root, path, eb, slot, key); - BUG_ON(ret); + if (ret) + goto out; } inode_add_bytes(inode, nbytes); @@ -717,20 +723,21 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans, inode = read_one_inode(root, location.objectid); if (!inode) { - kfree(name); - return -EIO; + ret = -EIO; + goto out; } ret = link_to_fixup_dir(trans, root, path, location.objectid); - BUG_ON(ret); + if (ret) + goto out; ret = btrfs_unlink_ino...
2010 Jul 29
1
[Bug] check return of kmalloc()
...36,8 +336,6 @@ static noinline int overwrite_item(struc btrfs_release_path(root, path); return 0; } - dst_copy = kmalloc(item_size, GFP_NOFS); - src_copy = kmalloc(item_size, GFP_NOFS); read_extent_buffer(eb, src_copy, src_ptr, item_size); @@ -664,7 +662,6 @@ static noinline int drop_one_dir_item(st btrfs_dir_item_key_to_cpu(leaf, di, &location); name_len = btrfs_dir_name_len(leaf, di); - name = kmalloc(name_len, GFP_NOFS); read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len); btrfs_release_path(root, path); @@ -819,7 +816,6 @@ again: ref = (struct btrfs_inode...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...lse if (found_type == BTRFS_FILE_EXTENT_INLINE) { /* inline extents are easy, we just overwrite them */ ret = overwrite_item(trans, root, path, eb, slot, key); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); } inode_set_bytes(inode, saved_nbytes); @@ -672,10 +672,10 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans, BUG_ON(!inode); ret = link_to_fixup_dir(trans, root, path, location.objectid); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); ret = btrfs_unlink_inode(trans, root, dir, inode, name, name_len); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); kfree(name); ip...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...id) @@ -920,7 +921,7 @@ again: btrfs_release_path(path); /* look for a conflicing name */ - di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), + di = btrfs_lookup_dir_item(trans, root, dir, path, btrfs_ino(dir), name, namelen, 0); if (di && !IS_ERR(di)) { ret = drop_one_dir_item(trans, root, path, dir, di); @@ -1227,8 +1228,9 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans, btrfs_release_path(path); if (key->type == BTRFS_DIR_ITEM_KEY) { - dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, - name, name_len, 1); +...