* [PATCH] xfs_db: disallow sb UUID write on v5 filesystems
@ 2015-04-06 15:06 Eric Sandeen
2015-04-07 13:37 ` Brian Foster
2015-04-07 13:58 ` [PATCH V2] " Eric Sandeen
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2015-04-06 15:06 UTC (permalink / raw)
To: xfs-oss, F. Stoyan, 782012
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@swapon.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
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.
+ */
+ 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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xfs_db: disallow sb UUID write on v5 filesystems
2015-04-06 15:06 [PATCH] xfs_db: disallow sb UUID write on v5 filesystems Eric Sandeen
@ 2015-04-07 13:37 ` Brian Foster
2015-04-07 13:58 ` [PATCH V2] " Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2015-04-07 13:37 UTC (permalink / raw)
To: Eric Sandeen; +Cc: 782012, xfs-oss
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@swapon.de>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> 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@redhat.com>
> + 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@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH V2] xfs_db: disallow sb UUID write on v5 filesystems
2015-04-06 15:06 [PATCH] xfs_db: disallow sb UUID write on v5 filesystems Eric Sandeen
2015-04-07 13:37 ` Brian Foster
@ 2015-04-07 13:58 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2015-04-07 13:58 UTC (permalink / raw)
To: Eric Sandeen, xfs-oss, F. Stoyan
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@swapon.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
---
V2, fix up comment whitespace :/
(and add brian's review for dave's convenience)
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.
+ */
+ 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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-07 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06 15:06 [PATCH] xfs_db: disallow sb UUID write on v5 filesystems Eric Sandeen
2015-04-07 13:37 ` Brian Foster
2015-04-07 13:58 ` [PATCH V2] " Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox