From: Kent Overstreet Date: Mon, 12 May 2025 18:54:07 +0000 (-0400) Subject: bcachefs: add missing locking in bch2_write_point_to_text() X-Git-Tag: v6.16-rc1~211^2~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ad7497862a2484333fa6a054aeab11a9b2f979b;p=thirdparty%2Fkernel%2Flinux.git bcachefs: add missing locking in bch2_write_point_to_text() Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index 828cf94217ddc..6aefa490ec242 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -1517,6 +1517,8 @@ static void bch2_write_point_to_text(struct printbuf *out, struct bch_fs *c, struct open_bucket *ob; unsigned i; + mutex_lock(&wp->lock); + prt_printf(out, "%lu: ", wp->write_point); prt_human_readable_u64(out, wp->sectors_allocated << 9); @@ -1534,6 +1536,8 @@ static void bch2_write_point_to_text(struct printbuf *out, struct bch_fs *c, open_bucket_for_each(c, &wp->ptrs, ob, i) bch2_open_bucket_to_text(out, c, ob); printbuf_indent_sub(out, 2); + + mutex_unlock(&wp->lock); } void bch2_write_points_to_text(struct printbuf *out, struct bch_fs *c)