bcachefs: Fix a kasan splat in bch2_dev_add()
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 26 Oct 2023 21:00:36 +0000 (17:00 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 2 Nov 2023 01:11:07 +0000 (21:11 -0400)
commite84843489c15bf9d39eec3a9a95870f98a71ac24
treeb7455d729872ef95a438e9001b8dabb16d17c8cc
parent5c1ab40e76dd873bfbfbe4df98ca3e08de31d30d
bcachefs: Fix a kasan splat in bch2_dev_add()

This fixes a use after free - mi is dangling after the resize call.

Additionally, resizing the device's member info section was useless - we
were attempting to preallocate the space required before adding it to
the filesystem superblock, but there's other sections that we should
have been preallocating as well for that to work.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super.c