浏览代码

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>
Chris Mason 14 年之前
父节点
当前提交
ac08aedfa5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      fs/btrfs/disk-io.c

+ 3 - 1
fs/btrfs/disk-io.c

@@ -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;