]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: On device add, prefer unused slots
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 30 Apr 2024 08:24:58 +0000 (04:24 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:29:22 +0000 (17:29 -0400)
commit3a718c0647680965171a19c2524c137be8f287b9
tree94350cd8a53eb8eed0575cb9dc9184200f99b0ec
parentffcbec607613bf8f83c06ae2d3cfe017de52f917
bcachefs: On device add, prefer unused slots

We can't strictly guarantee that no pointers refer to nonexistent
devices - we attempt to, but we need to be safe when the filesystem is
corrupt.

Therefore, change device_add to try to pick a slot that's never been
used, or the slot that's been unused the longest.

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