aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/bcachefs/sysfs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-29 20:58:32 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-30 16:35:13 -0400
commit393a05a7413aa325a15c6d3b35867843f91f1646 (patch)
tree26f56ec08e9d4d27cd9ee315ab1e599d072d87e0 /fs/bcachefs/sysfs.c
parentbcachefs: Silence errors after emergency shutdown (diff)
downloadwireguard-linux-393a05a7413aa325a15c6d3b35867843f91f1646.tar.xz
wireguard-linux-393a05a7413aa325a15c6d3b35867843f91f1646.zip
bcachefs: Don't use designated initializers for disk_accounting_pos
Not all compilers fully initialize these - they're not guaranteed to because of the union shenanigans. Fixes: https://github.com/koverstreet/bcachefs/issues/844 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r--fs/bcachefs/sysfs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index 74c186d65d1f..e5f003c29369 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -257,10 +257,8 @@ static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
prt_printf(out, "type\tcompressed\runcompressed\raverage extent size\r\n");
for (unsigned i = 1; i < BCH_COMPRESSION_TYPE_NR; i++) {
- struct disk_accounting_pos a = {
- .type = BCH_DISK_ACCOUNTING_compression,
- .compression.type = i,
- };
+ struct disk_accounting_pos a;
+ disk_accounting_key_init(a, compression, .type = i);
struct bpos p = disk_accounting_pos_to_bpos(&a);
u64 v[3];
bch2_accounting_mem_read(c, p, v, ARRAY_SIZE(v));