diff options
author | Yan <yanzheng@21cn.com> | 2008-04-01 11:21:34 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | e58ca0203d32869a01540a293df40ddc480dc378 (patch) | |
tree | a0a7c4f66d296ea9dd12d13f2c9e7531401b96bf /fs/btrfs | |
parent | 63b10fc4874a014e22bc4c64e3d92b71180661fe (diff) |
Fix btrfs_fill_super to return -EINVAL when no FS found
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 | ||||
-rw-r--r-- | fs/btrfs/super.c | 4 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 709e33d08bb5..5547607681f4 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -728,9 +728,8 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
728 | struct btrfs_root *dev_root = kmalloc(sizeof(struct btrfs_root), | 728 | struct btrfs_root *dev_root = kmalloc(sizeof(struct btrfs_root), |
729 | GFP_NOFS); | 729 | GFP_NOFS); |
730 | int ret; | 730 | int ret; |
731 | int err = -EIO; | 731 | int err = -EINVAL; |
732 | struct btrfs_super_block *disk_super; | 732 | struct btrfs_super_block *disk_super; |
733 | |||
734 | if (!extent_root || !tree_root || !fs_info) { | 733 | if (!extent_root || !tree_root || !fs_info) { |
735 | err = -ENOMEM; | 734 | err = -ENOMEM; |
736 | goto fail; | 735 | goto fail; |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 9624923a33dc..892864906880 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -236,9 +236,9 @@ static int btrfs_fill_super(struct super_block * sb, | |||
236 | 236 | ||
237 | tree_root = open_ctree(sb, fs_devices); | 237 | tree_root = open_ctree(sb, fs_devices); |
238 | 238 | ||
239 | if (!tree_root || IS_ERR(tree_root)) { | 239 | if (IS_ERR(tree_root)) { |
240 | printk("btrfs: open_ctree failed\n"); | 240 | printk("btrfs: open_ctree failed\n"); |
241 | return -EIO; | 241 | return PTR_ERR(tree_root); |
242 | } | 242 | } |
243 | sb->s_fs_info = tree_root; | 243 | sb->s_fs_info = tree_root; |
244 | disk_super = &tree_root->fs_info->super_copy; | 244 | disk_super = &tree_root->fs_info->super_copy; |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d8fce32a3bbc..169be0f7285b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -237,7 +237,7 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder, | |||
237 | if (strncmp((char *)(&disk_super->magic), BTRFS_MAGIC, | 237 | if (strncmp((char *)(&disk_super->magic), BTRFS_MAGIC, |
238 | sizeof(disk_super->magic))) { | 238 | sizeof(disk_super->magic))) { |
239 | printk("no btrfs found on %s\n", path); | 239 | printk("no btrfs found on %s\n", path); |
240 | ret = -ENOENT; | 240 | ret = -EINVAL; |
241 | goto error_brelse; | 241 | goto error_brelse; |
242 | } | 242 | } |
243 | devid = le64_to_cpu(disk_super->dev_item.devid); | 243 | devid = le64_to_cpu(disk_super->dev_item.devid); |