Skip to content

Commit

Permalink
Btrfs: add the missing mutex unlock in write_all_supers()
Browse files Browse the repository at this point in the history
The BUG() was replaced by btrfs_error() and return -EIO with the
patch "get rid of one BUG() in write_all_supers()", but the missing
mutex_unlock() was overlooked.

The 0-DAY kernel build service from Intel reported the missing
unlock which was found by the coccinelle tool:

    fs/btrfs/disk-io.c:3422:2-8: preceding lock on line 3374

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Stefan Behrens authored and Chris Mason committed Sep 21, 2013
1 parent f4ab9ea commit a724b43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3416,6 +3416,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
if (total_errors > max_errors) {
printk(KERN_ERR "btrfs: %d errors while writing supers\n",
total_errors);
mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);

/* FUA is masked off if unsupported and can't be the reason */
btrfs_error(root->fs_info, -EIO,
Expand Down

0 comments on commit a724b43

Please sign in to comment.