Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231761
b: refs/heads/master
c: 20b4507
h: refs/heads/master
i:
  231759: b3dcd13
v: v3
  • Loading branch information
Dave Young authored and Chris Mason committed Jan 16, 2011
1 parent e687222 commit 7cfa254
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42838bb265b9cff3de9587fcacc398b5112dc2d9
refs/heads/master: 20b450773d17e325190c158e10bfdb25dc21d2d6
4 changes: 3 additions & 1 deletion trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,8 +1713,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info, BTRFS_ROOT_TREE_OBJECTID);

bh = btrfs_read_dev_super(fs_devices->latest_bdev);
if (!bh)
if (!bh) {
err = -EINVAL;
goto fail_iput;
}

memcpy(&fs_info->super_copy, bh->b_data, sizeof(fs_info->super_copy));
memcpy(&fs_info->super_for_commit, &fs_info->super_copy,
Expand Down
8 changes: 5 additions & 3 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,10 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
set_blocksize(bdev, 4096);

bh = btrfs_read_dev_super(bdev);
if (!bh)
if (!bh) {
ret = -EINVAL;
goto error_close;
}

disk_super = (struct btrfs_super_block *)bh->b_data;
devid = btrfs_stack_device_id(&disk_super->dev_item);
Expand Down Expand Up @@ -702,7 +704,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
goto error_close;
bh = btrfs_read_dev_super(bdev);
if (!bh) {
ret = -EIO;
ret = -EINVAL;
goto error_close;
}
disk_super = (struct btrfs_super_block *)bh->b_data;
Expand Down Expand Up @@ -1302,7 +1304,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
set_blocksize(bdev, 4096);
bh = btrfs_read_dev_super(bdev);
if (!bh) {
ret = -EIO;
ret = -EINVAL;
goto error_close;
}
disk_super = (struct btrfs_super_block *)bh->b_data;
Expand Down

0 comments on commit 7cfa254

Please sign in to comment.