diff options
author | Nikita Ofitserov <himikof@gmail.com> | 2025-09-07 00:24:20 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-09-06 17:56:19 -0400 |
commit | a1e870abb7e4791fac161d857478992b71bfd80f (patch) | |
tree | 1eb62f294c38ffea7fd7ae25cb80fd2c8b110f5e /c_src | |
parent | b1021e7b3996b7f0d532e58bb576c1766a95bcb9 (diff) |
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 <himikof@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src')
-rw-r--r-- | c_src/cmd_migrate.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |