Commit 03c751a5 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "None of these are huge, but my commit does fix a regression from 3.18
  that could cause lost files during log replay.

  This also adds Dave Sterba to the list of Btrfs maintainers.  It
  doesn't mean we're doing things differently, but Dave has really been
  helping with the maintainer workload for years"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: don't delay inode ref updates during log replay
  Btrfs: correctly get tree level in tree_backref_for_extent
  Btrfs: call inode_dec_link_count() on mkdir error path
  Btrfs: abort transaction if we don't find the block group
  Btrfs, scrub: uninitialized variable in scrub_extent_for_parity()
  Btrfs: add more maintainers
parents b3d574ae 6f896054
...@@ -2259,6 +2259,7 @@ F: drivers/gpio/gpio-bt8xx.c ...@@ -2259,6 +2259,7 @@ F: drivers/gpio/gpio-bt8xx.c
BTRFS FILE SYSTEM BTRFS FILE SYSTEM
M: Chris Mason <clm@fb.com> M: Chris Mason <clm@fb.com>
M: Josef Bacik <jbacik@fb.com> M: Josef Bacik <jbacik@fb.com>
M: David Sterba <dsterba@suse.cz>
L: linux-btrfs@vger.kernel.org L: linux-btrfs@vger.kernel.org
W: http://btrfs.wiki.kernel.org/ W: http://btrfs.wiki.kernel.org/
Q: http://patchwork.kernel.org/project/linux-btrfs/list/ Q: http://patchwork.kernel.org/project/linux-btrfs/list/
......
...@@ -1552,7 +1552,6 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, ...@@ -1552,7 +1552,6 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb,
{ {
int ret; int ret;
int type; int type;
struct btrfs_tree_block_info *info;
struct btrfs_extent_inline_ref *eiref; struct btrfs_extent_inline_ref *eiref;
if (*ptr == (unsigned long)-1) if (*ptr == (unsigned long)-1)
...@@ -1573,9 +1572,17 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, ...@@ -1573,9 +1572,17 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb,
} }
/* we can treat both ref types equally here */ /* we can treat both ref types equally here */
info = (struct btrfs_tree_block_info *)(ei + 1);
*out_root = btrfs_extent_inline_ref_offset(eb, eiref); *out_root = btrfs_extent_inline_ref_offset(eb, eiref);
if (key->type == BTRFS_EXTENT_ITEM_KEY) {
struct btrfs_tree_block_info *info;
info = (struct btrfs_tree_block_info *)(ei + 1);
*out_level = btrfs_tree_block_level(eb, info); *out_level = btrfs_tree_block_level(eb, info);
} else {
ASSERT(key->type == BTRFS_METADATA_ITEM_KEY);
*out_level = (u8)key->offset;
}
if (ret == 1) if (ret == 1)
*ptr = (unsigned long)-1; *ptr = (unsigned long)-1;
......
...@@ -1857,6 +1857,14 @@ int btrfs_delayed_delete_inode_ref(struct inode *inode) ...@@ -1857,6 +1857,14 @@ int btrfs_delayed_delete_inode_ref(struct inode *inode)
{ {
struct btrfs_delayed_node *delayed_node; struct btrfs_delayed_node *delayed_node;
/*
* we don't do delayed inode updates during log recovery because it
* leads to enospc problems. This means we also can't do
* delayed inode refs
*/
if (BTRFS_I(inode)->root->fs_info->log_root_recovering)
return -EAGAIN;
delayed_node = btrfs_get_or_create_delayed_node(inode); delayed_node = btrfs_get_or_create_delayed_node(inode);
if (IS_ERR(delayed_node)) if (IS_ERR(delayed_node))
return PTR_ERR(delayed_node); return PTR_ERR(delayed_node);
......
...@@ -3139,9 +3139,11 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans, ...@@ -3139,9 +3139,11 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
struct extent_buffer *leaf; struct extent_buffer *leaf;
ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1); ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1);
if (ret < 0) if (ret) {
if (ret > 0)
ret = -ENOENT;
goto fail; goto fail;
BUG_ON(ret); /* Corruption */ }
leaf = path->nodes[0]; leaf = path->nodes[0];
bi = btrfs_item_ptr_offset(leaf, path->slots[0]); bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
...@@ -3149,11 +3151,9 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans, ...@@ -3149,11 +3151,9 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(path); btrfs_release_path(path);
fail: fail:
if (ret) { if (ret)
btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret);
return ret; return ret;
}
return 0;
} }
......
...@@ -6255,8 +6255,10 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -6255,8 +6255,10 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
out_fail: out_fail:
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
if (drop_on_err) if (drop_on_err) {
inode_dec_link_count(inode);
iput(inode); iput(inode);
}
btrfs_balance_delayed_items(root); btrfs_balance_delayed_items(root);
btrfs_btree_balance_dirty(root); btrfs_btree_balance_dirty(root);
return err; return err;
......
...@@ -2607,9 +2607,9 @@ static int scrub_extent_for_parity(struct scrub_parity *sparity, ...@@ -2607,9 +2607,9 @@ static int scrub_extent_for_parity(struct scrub_parity *sparity,
ret = scrub_pages_for_parity(sparity, logical, l, physical, dev, ret = scrub_pages_for_parity(sparity, logical, l, physical, dev,
flags, gen, mirror_num, flags, gen, mirror_num,
have_csum ? csum : NULL); have_csum ? csum : NULL);
skip:
if (ret) if (ret)
return ret; return ret;
skip:
len -= l; len -= l;
logical += l; logical += l;
physical += l; physical += l;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment