mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-22 00:00:19 +03:00
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>
This commit is contained in:
parent
b1021e7b39
commit
a1e870abb7
@ -452,7 +452,8 @@ int cmd_migrate_superblock(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Rewrite first 0-3.5k bytes with zeroes, ensuring we blow away
|
/* Rewrite first 0-3.5k bytes with zeroes, ensuring we blow away
|
||||||
* the old superblock */
|
* 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");
|
xpwrite(fd, zeroes, ARRAY_SIZE(zeroes), 0, "zeroing start of disk");
|
||||||
|
|
||||||
xclose(fd);
|
xclose(fd);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user