Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mason/linux-btrfs

Pull btrfs updates from Chris Mason:
 "I have two additional and btrfs fixes in my for-linus branch.  One is
  a casting error that leads to memory corruption on i386 during scrub,
  and the other fixes a corner case in the backref walking code (also
  triggered by scrub)."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix casting error in scrub reada code
  btrfs: fix locking issues in find_parent_nodes()
  • Loading branch information
torvalds committed Mar 10, 2012
2 parents be22aec + a175423 commit 86e0600
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions fs/btrfs/backref.c
Expand Up @@ -583,7 +583,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
struct btrfs_path *path;
struct btrfs_key info_key = { 0 };
struct btrfs_delayed_ref_root *delayed_refs = NULL;
struct btrfs_delayed_ref_head *head = NULL;
struct btrfs_delayed_ref_head *head;
int info_level = 0;
int ret;
struct list_head prefs_delayed;
Expand All @@ -607,6 +607,8 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
* at a specified point in time
*/
again:
head = NULL;

ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -635,8 +637,10 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
goto again;
}
ret = __add_delayed_refs(head, seq, &info_key, &prefs_delayed);
if (ret)
if (ret) {
spin_unlock(&delayed_refs->lock);
goto out;
}
}
spin_unlock(&delayed_refs->lock);

Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/reada.c
Expand Up @@ -305,7 +305,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info,

spin_lock(&fs_info->reada_lock);
ret = radix_tree_insert(&dev->reada_zones,
(unsigned long)zone->end >> PAGE_CACHE_SHIFT,
(unsigned long)(zone->end >> PAGE_CACHE_SHIFT),
zone);
spin_unlock(&fs_info->reada_lock);

Expand Down

0 comments on commit 86e0600

Please sign in to comment.