Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233682
b: refs/heads/master
c: 9b3517e
h: refs/heads/master
v: v3
  • Loading branch information
Ilya Dryomov authored and Chris Mason committed Feb 16, 2011
1 parent 0e7f835 commit 249e776
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: ca9b688c1c9a21635cfc8af8b68565b154185196
refs/heads/master: 9b3517e9136824346227b7b04f8f7ea1f3a726cc
11 changes: 9 additions & 2 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,11 +1337,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)

ret = btrfs_shrink_device(device, 0);
if (ret)
goto error_brelse;
goto error_undo;

ret = btrfs_rm_dev_item(root->fs_info->chunk_root, device);
if (ret)
goto error_brelse;
goto error_undo;

device->in_fs_metadata = 0;

Expand Down Expand Up @@ -1415,6 +1415,13 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
mutex_unlock(&root->fs_info->volume_mutex);
mutex_unlock(&uuid_mutex);
return ret;
error_undo:
if (device->writeable) {
list_add(&device->dev_alloc_list,
&root->fs_info->fs_devices->alloc_list);
root->fs_info->fs_devices->rw_devices++;
}
goto error_brelse;
}

/*
Expand Down

0 comments on commit 249e776

Please sign in to comment.