Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346673
b: refs/heads/master
c: d25628b
h: refs/heads/master
i:
  346671: ac44d1c
v: v3
  • Loading branch information
Liu Bo authored and Josef Bacik committed Dec 12, 2012
1 parent cda2248 commit 8575662
Show file tree
Hide file tree
Showing 2 changed files with 6 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: b53d3f5db2b79637acadc06a330db6c2c60863f5
refs/heads/master: d25628bdd66aedd6e07729d8dc6c8ee846d66d72
9 changes: 5 additions & 4 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1681,16 +1681,17 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
filemap_write_and_wait(bdev->bd_inode->i_mapping);

devices = &root->fs_info->fs_devices->devices;
/*
* we have the volume lock, so we don't need the extra
* device list mutex while reading the list here.
*/

mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
list_for_each_entry(device, devices, dev_list) {
if (device->bdev == bdev) {
ret = -EEXIST;
mutex_unlock(
&root->fs_info->fs_devices->device_list_mutex);
goto error;
}
}
mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);

device = kzalloc(sizeof(*device), GFP_NOFS);
if (!device) {
Expand Down

0 comments on commit 8575662

Please sign in to comment.