Skip to content

Commit

Permalink
Btrfs: check the return value from set_anon_super
Browse files Browse the repository at this point in the history
Al Viro noticed we weren't checking for set_anon_super failures.  This
adds the required checks.

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
chrismason-xx committed Jun 13, 2011
1 parent 30b4caf commit ac08aed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,9 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
spin_lock_init(&root->cache_lock);
init_waitqueue_head(&root->cache_wait);

set_anon_super(&root->anon_super, NULL);
ret = set_anon_super(&root->anon_super, NULL);
if (ret)
goto fail;

if (btrfs_root_refs(&root->root_item) == 0) {
ret = -ENOENT;
Expand Down

0 comments on commit ac08aed

Please sign in to comment.