Skip to content

Commit

Permalink
Revert "Btrfs: device_list_add() should not update list when mounted"
Browse files Browse the repository at this point in the history
This reverts commit b96de00.

This commit is triggering failures to mount by subvolume id in some
configurations.  The main problem is how many different ways this
scanning function is used, both for scanning while mounted and
unmounted.  A proper cleanup is too big for late rcs.

For now, just revert the commit and we'll put a better fix into a later
merge window.

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
masoncl committed Sep 18, 2014
1 parent 125c4cf commit 0f23ae7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,21 +529,20 @@ static noinline int device_list_add(const char *path,
*/

/*
* As of now don't allow update to btrfs_fs_device through
* the btrfs dev scan cli, after FS has been mounted.
* For now, we do allow update to btrfs_fs_device through the
* btrfs dev scan cli after FS has been mounted. We're still
* tracking a problem where systems fail mount by subvolume id
* when we reject replacement on a mounted FS.
*/
if (fs_devices->opened) {
return -EBUSY;
} else {
if (!fs_devices->opened && found_transid < device->generation) {
/*
* That is if the FS is _not_ mounted and if you
* are here, that means there is more than one
* disk with same uuid and devid.We keep the one
* with larger generation number or the last-in if
* generation are equal.
*/
if (found_transid < device->generation)
return -EEXIST;
return -EEXIST;
}

name = rcu_string_strdup(path, GFP_NOFS);
Expand Down

0 comments on commit 0f23ae7

Please sign in to comment.