From a1e870abb7e4791fac161d857478992b71bfd80f Mon Sep 17 00:00:00 2001 From: Nikita Ofitserov Date: Sun, 7 Sep 2025 00:24:20 +0300 Subject: cmd_migrate: Prevent spurious "Superblock modified by another process" errors This is only a workaround for the superblock writing process always reading back the first sb in the layout and checking its sequence number. Zeroing it out ensures a harmless warning instead of an error. Signed-off-by: Nikita Ofitserov Signed-off-by: Kent Overstreet --- c_src/cmd_migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'c_src') diff --git a/c_src/cmd_migrate.c b/c_src/cmd_migrate.c index f211a0f2..4e4fbcba 100644 --- a/c_src/cmd_migrate.c +++ b/c_src/cmd_migrate.c @@ -452,7 +452,8 @@ int cmd_migrate_superblock(int argc, char *argv[]) /* Rewrite first 0-3.5k bytes with zeroes, ensuring we blow away * the old superblock */ - static const char zeroes[BCH_SB_SECTOR << 9]; + // TODO: fix the "Superblock write was silently dropped" warning properly + static const char zeroes[(BCH_SB_SECTOR << 9) + sizeof(struct bch_sb)]; xpwrite(fd, zeroes, ARRAY_SIZE(zeroes), 0, "zeroing start of disk"); xclose(fd); -- cgit v1.2.3