aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2014-09-18 10:49:05 -0400
committerChris Mason <clm@fb.com>2014-09-18 10:49:05 -0400
commit0f23ae74f589304bf33233f85737f4fd368549eb (patch)
treede0bfb94edee990680af5b4e4aaaa23f8edd557b /fs
parent125c4cf9f37c98fed2c08229b31358cfec63dcf6 (diff)
Revert "Btrfs: device_list_add() should not update list when mounted"
This reverts commit b96de000bc8bc9688b3a2abea4332bd57648a49f. 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 <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 340a92d08e84..2c2d6d1d8eee 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -529,12 +529,12 @@ static noinline int device_list_add(const char *path,
529 */ 529 */
530 530
531 /* 531 /*
532 * As of now don't allow update to btrfs_fs_device through 532 * For now, we do allow update to btrfs_fs_device through the
533 * the btrfs dev scan cli, after FS has been mounted. 533 * btrfs dev scan cli after FS has been mounted. We're still
534 * tracking a problem where systems fail mount by subvolume id
535 * when we reject replacement on a mounted FS.
534 */ 536 */
535 if (fs_devices->opened) { 537 if (!fs_devices->opened && found_transid < device->generation) {
536 return -EBUSY;
537 } else {
538 /* 538 /*
539 * That is if the FS is _not_ mounted and if you 539 * That is if the FS is _not_ mounted and if you
540 * are here, that means there is more than one 540 * are here, that means there is more than one
@@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path,
542 * with larger generation number or the last-in if 542 * with larger generation number or the last-in if
543 * generation are equal. 543 * generation are equal.
544 */ 544 */
545 if (found_transid < device->generation) 545 return -EEXIST;
546 return -EEXIST;
547 } 546 }
548 547
549 name = rcu_string_strdup(path, GFP_NOFS); 548 name = rcu_string_strdup(path, GFP_NOFS);