linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "Btrfs: device_list_add() should not update list when
@ 2014-09-18 15:00 Chris Mason
  2014-09-19 10:21 ` Anand Jain
  2014-09-19 13:47 ` Sam Thursfield
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Mason @ 2014-09-18 15:00 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs, Sam Thursfield, johannes.hirte


Johannes and Sam, could you please confirm this patch fixes your mount
regression for now?  Anand, please make sure I kept the generation check
properly.

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>
---
 fs/btrfs/volumes.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 340a92d..2c2d6d1 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -529,12 +529,12 @@ 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
@@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path,
 			 * 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);
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "Btrfs: device_list_add() should not update list when
  2014-09-18 15:00 [PATCH] Revert "Btrfs: device_list_add() should not update list when Chris Mason
@ 2014-09-19 10:21 ` Anand Jain
  2014-09-19 13:47 ` Sam Thursfield
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2014-09-19 10:21 UTC (permalink / raw)
  To: Chris Mason; +Cc: linux-btrfs, Sam Thursfield, johannes.hirte



   Looks good to me Chris. Thank you.


Reviewed-by: Anand Jain <anand.jain@oracle.com>


On 09/18/2014 11:00 PM, Chris Mason wrote:
>
> Johannes and Sam, could you please confirm this patch fixes your mount
> regression for now?  Anand, please make sure I kept the generation check
> properly.
>
> 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>
> ---
>   fs/btrfs/volumes.c | 13 ++++++-------
>   1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 340a92d..2c2d6d1 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -529,12 +529,12 @@ 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
> @@ -542,8 +542,7 @@ static noinline int device_list_add(const char *path,
>   			 * 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);
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "Btrfs: device_list_add() should not update list when
  2014-09-18 15:00 [PATCH] Revert "Btrfs: device_list_add() should not update list when Chris Mason
  2014-09-19 10:21 ` Anand Jain
@ 2014-09-19 13:47 ` Sam Thursfield
  2014-09-19 13:59   ` Chris Mason
  1 sibling, 1 reply; 4+ messages in thread
From: Sam Thursfield @ 2014-09-19 13:47 UTC (permalink / raw)
  To: Chris Mason, Anand Jain, linux-btrfs, johannes.hirte

On 18/09/14 16:00, Chris Mason wrote:
>
> Johannes and Sam, could you please confirm this patch fixes your mount
> regression for now?  Anand, please make sure I kept the generation check
> properly.

I've just tested this patch on top of 3.17-rc5 and it fixes the issue 
for me.

Thanks!
Sam


-- 
Sam Thursfield, Codethink Ltd.
Office telephone: +44 161 236 5575

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "Btrfs: device_list_add() should not update list when
  2014-09-19 13:47 ` Sam Thursfield
@ 2014-09-19 13:59   ` Chris Mason
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Mason @ 2014-09-19 13:59 UTC (permalink / raw)
  To: Sam Thursfield, Anand Jain, linux-btrfs, johannes.hirte

On 09/19/2014 09:47 AM, Sam Thursfield wrote:
> On 18/09/14 16:00, Chris Mason wrote:
>>
>> Johannes and Sam, could you please confirm this patch fixes your mount
>> regression for now?  Anand, please make sure I kept the generation check
>> properly.
> 
> I've just tested this patch on top of 3.17-rc5 and it fixes the issue
> for me.
> 

Perfect, thanks.

-chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-19 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 15:00 [PATCH] Revert "Btrfs: device_list_add() should not update list when Chris Mason
2014-09-19 10:21 ` Anand Jain
2014-09-19 13:47 ` Sam Thursfield
2014-09-19 13:59   ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).