xfs
[Top] [All Lists]

Re: [PATCH] xfs_db: disallow sb UUID write on v5 filesystems

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH] xfs_db: disallow sb UUID write on v5 filesystems
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 7 Apr 2015 09:37:14 -0400
Cc: xfs-oss <xfs@xxxxxxxxxxx>, "F. Stoyan" <fstoyan@xxxxxxxxx>, 782012@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <5522A0DB.2010309@xxxxxxxxxx>
References: <5522A0DB.2010309@xxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Mon, Apr 06, 2015 at 10:06:03AM -0500, Eric Sandeen wrote:
> Do not allow xfs_db (or the xfs_admin frontend) to change the UUID
> of a V5 filesystem; this will cause UUID mismatches across the
> filesystem, and we currently have no mechanism to update them all.
> Changing only the superblock UUID makes all other metadata look
> invalid, and xfs_repair reacts by junking everything.
> 
> Addresses-Debian-Bug: 782012
> Reported-by: F. Stoyan <fstoyan@xxxxxxxxx>
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 
> diff --git a/db/sb.c b/db/sb.c
> index 6cb665d..f31f4a2 100644
> --- a/db/sb.c
> +++ b/db/sb.c
> @@ -363,6 +363,18 @@ uuid_f(
>                       return 0;
>               }
>  
> +             /*
> +             * For now, changing the UUID of V5 superblock filesystems is
> +             * not supported; we do not have the infrastructure to fix all
> +             * other metadata when a new superblock UUID is generated.
> +             */

Unaligned start of comment above. :) Otherwise looks fine to me:

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

> +             if (xfs_sb_version_hascrc(&mp->m_sb) &&
> +                 strcasecmp(argv[1], "rewrite")) {
> +                     dbprintf(_("%s: only 'rewrite' supported on V5 fs\n"),
> +                             progname);
> +                     return 0;
> +             }
> +
>               if (!strcasecmp(argv[1], "generate")) {
>                       platform_uuid_generate(&uu);
>               } else if (!strcasecmp(argv[1], "nil")) {
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>