mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
fix bch2_super_write() for bs > 4096
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix-Tests / nix-flake-check (push) Waiting to run
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix-Tests / nix-flake-check (push) Waiting to run
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
dd1a882d17
commit
86cbeaf1c2
@ -352,9 +352,9 @@ void bch2_super_write(int fd, struct bch_sb *sb)
|
|||||||
if (sb->offset == BCH_SB_SECTOR) {
|
if (sb->offset == BCH_SB_SECTOR) {
|
||||||
/* Write backup layout */
|
/* Write backup layout */
|
||||||
|
|
||||||
BUG_ON(bs > 4096);
|
unsigned buflen = max(bs, 4096);
|
||||||
|
|
||||||
char *buf = aligned_alloc(bs, bs);
|
char *buf = aligned_alloc(buflen, buflen);
|
||||||
xpread(fd, buf, bs, 4096 - bs);
|
xpread(fd, buf, bs, 4096 - bs);
|
||||||
memcpy(buf + bs - sizeof(sb->layout),
|
memcpy(buf + bs - sizeof(sb->layout),
|
||||||
&sb->layout,
|
&sb->layout,
|
||||||
|
Loading…
Reference in New Issue
Block a user