Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: cleanup error handling in inode.c
Btrfs: put the right bio if we have an error
Btrfs: free bitmaps properly when evicting the cache
Btrfs: Free free_space item properly in btrfs_trim_block_group()
btrfs: add missing spin_unlock to a rare exit path
Btrfs: check return value of kmalloc()
btrfs: fix wrong allocating flag when reading page
Btrfs: fix missing mutex_unlock in btrfs_del_dir_entries_in_log()

+32 -15
+1
fs/btrfs/disk-io.c
··· 2824 2824 2825 2825 spin_lock(&delayed_refs->lock); 2826 2826 if (delayed_refs->num_entries == 0) { 2827 + spin_unlock(&delayed_refs->lock); 2827 2828 printk(KERN_INFO "delayed_refs has NO entry\n"); 2828 2829 return ret; 2829 2830 }
+4
fs/btrfs/extent-tree.c
··· 8059 8059 u64 group_start = group->key.objectid; 8060 8060 new_extents = kmalloc(sizeof(*new_extents), 8061 8061 GFP_NOFS); 8062 + if (!new_extents) { 8063 + ret = -ENOMEM; 8064 + goto out; 8065 + } 8062 8066 nr_extents = 1; 8063 8067 ret = get_new_locations(reloc_inode, 8064 8068 extent_key,
+1 -1
fs/btrfs/extent_io.c
··· 2681 2681 prefetchw(&page->flags); 2682 2682 list_del(&page->lru); 2683 2683 if (!add_to_page_cache_lru(page, mapping, 2684 - page->index, GFP_KERNEL)) { 2684 + page->index, GFP_NOFS)) { 2685 2685 __extent_read_full_page(tree, page, get_extent, 2686 2686 &bio, 0, &bio_flags); 2687 2687 }
+8 -5
fs/btrfs/free-space-cache.c
··· 1768 1768 1769 1769 while ((node = rb_last(&block_group->free_space_offset)) != NULL) { 1770 1770 info = rb_entry(node, struct btrfs_free_space, offset_index); 1771 - unlink_free_space(block_group, info); 1772 - if (info->bitmap) 1773 - kfree(info->bitmap); 1774 - kmem_cache_free(btrfs_free_space_cachep, info); 1771 + if (!info->bitmap) { 1772 + unlink_free_space(block_group, info); 1773 + kmem_cache_free(btrfs_free_space_cachep, info); 1774 + } else { 1775 + free_bitmap(block_group, info); 1776 + } 1777 + 1775 1778 if (need_resched()) { 1776 1779 spin_unlock(&block_group->tree_lock); 1777 1780 cond_resched(); ··· 2304 2301 start = entry->offset; 2305 2302 bytes = min(entry->bytes, end - start); 2306 2303 unlink_free_space(block_group, entry); 2307 - kfree(entry); 2304 + kmem_cache_free(btrfs_free_space_cachep, entry); 2308 2305 } 2309 2306 2310 2307 spin_unlock(&block_group->tree_lock);
+13 -7
fs/btrfs/inode.c
··· 954 954 1, 0, NULL, GFP_NOFS); 955 955 while (start < end) { 956 956 async_cow = kmalloc(sizeof(*async_cow), GFP_NOFS); 957 + BUG_ON(!async_cow); 957 958 async_cow->inode = inode; 958 959 async_cow->root = root; 959 960 async_cow->locked_page = locked_page; ··· 4732 4731 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, 4733 4732 dentry->d_name.len, dir->i_ino, objectid, 4734 4733 BTRFS_I(dir)->block_group, mode, &index); 4735 - err = PTR_ERR(inode); 4736 - if (IS_ERR(inode)) 4734 + if (IS_ERR(inode)) { 4735 + err = PTR_ERR(inode); 4737 4736 goto out_unlock; 4737 + } 4738 4738 4739 4739 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name); 4740 4740 if (err) { ··· 4794 4792 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, 4795 4793 dentry->d_name.len, dir->i_ino, objectid, 4796 4794 BTRFS_I(dir)->block_group, mode, &index); 4797 - err = PTR_ERR(inode); 4798 - if (IS_ERR(inode)) 4795 + if (IS_ERR(inode)) { 4796 + err = PTR_ERR(inode); 4799 4797 goto out_unlock; 4798 + } 4800 4799 4801 4800 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name); 4802 4801 if (err) { ··· 5002 4999 inline_size = btrfs_file_extent_inline_item_len(leaf, 5003 5000 btrfs_item_nr(leaf, path->slots[0])); 5004 5001 tmp = kmalloc(inline_size, GFP_NOFS); 5002 + if (!tmp) 5003 + return -ENOMEM; 5005 5004 ptr = btrfs_file_extent_inline_start(item); 5006 5005 5007 5006 read_extent_buffer(leaf, tmp, ptr, inline_size); ··· 6041 6036 ret = btrfs_map_block(map_tree, READ, start_sector << 9, 6042 6037 &map_length, NULL, 0); 6043 6038 if (ret) { 6044 - bio_put(bio); 6039 + bio_put(orig_bio); 6045 6040 return -EIO; 6046 6041 } 6047 6042 ··· 7278 7273 dentry->d_name.len, dir->i_ino, objectid, 7279 7274 BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO, 7280 7275 &index); 7281 - err = PTR_ERR(inode); 7282 - if (IS_ERR(inode)) 7276 + if (IS_ERR(inode)) { 7277 + err = PTR_ERR(inode); 7283 7278 goto out_unlock; 7279 + } 7284 7280 7285 7281 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name); 7286 7282 if (err) {
+5 -2
fs/btrfs/tree-log.c
··· 2209 2209 2210 2210 log = root->log_root; 2211 2211 path = btrfs_alloc_path(); 2212 - if (!path) 2213 - return -ENOMEM; 2212 + if (!path) { 2213 + err = -ENOMEM; 2214 + goto out_unlock; 2215 + } 2214 2216 2215 2217 di = btrfs_lookup_dir_item(trans, log, path, dir->i_ino, 2216 2218 name, name_len, -1); ··· 2273 2271 } 2274 2272 fail: 2275 2273 btrfs_free_path(path); 2274 + out_unlock: 2276 2275 mutex_unlock(&BTRFS_I(dir)->log_mutex); 2277 2276 if (ret == -ENOSPC) { 2278 2277 root->fs_info->last_trans_log_full_commit = trans->transid;