Btrfs: check the return value from set_anon_super

Al Viro noticed we weren't checking for set_anon_super failures.  This
adds the required checks.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason 2011-06-13 11:28:50 -04:00
parent 30b4caf5d7
commit ac08aedfa5
1 changed files with 3 additions and 1 deletions

View File

@ -1312,7 +1312,9 @@ again:
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;