Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252339
b: refs/heads/master
c: 0c1daee
h: refs/heads/master
i:
  252337: df55db0
  252335: d5ecd0b
v: v3
  • Loading branch information
Xiao Guangrong authored and Chris Mason committed May 23, 2011
1 parent 33df796 commit 83fe4f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9513edb0079f97749c2ac00c887a22c4ba44792
refs/heads/master: 0c1daee085cff1395d1eba4ad6faff7810a594d8
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,9 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
}

if (device->writeable) {
lock_chunks(root);
list_del_init(&device->dev_alloc_list);
unlock_chunks(root);
root->fs_info->fs_devices->rw_devices--;
}

Expand Down Expand Up @@ -1345,7 +1347,9 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
}
fs_devices->seed = device->fs_devices->seed;
device->fs_devices->seed = NULL;
lock_chunks(root);
__btrfs_close_devices(device->fs_devices);
unlock_chunks(root);
free_fs_devices(device->fs_devices);
}

Expand Down Expand Up @@ -1377,8 +1381,10 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
return ret;
error_undo:
if (device->writeable) {
lock_chunks(root);
list_add(&device->dev_alloc_list,
&root->fs_info->fs_devices->alloc_list);
unlock_chunks(root);
root->fs_info->fs_devices->rw_devices++;
}
goto error_brelse;
Expand Down

0 comments on commit 83fe4f0

Please sign in to comment.