bcachefs: Fix potential sleeping during mount
PATCH 1/1 bcachefs: Fix potential sleeping during mount
During mount, bcachefs mount option processing may sleep while allocating a string buffer.
Fix this by reference counting in order to take the atomic path.
Signed-off-by Daniel J Blueman <[email protected]>
--- fs/bcachefs/disk_groups.c | 2 ++ 1 file changed, 2 insertions(+)
fs/bcachefs/disk_groups.c +2 -0
@@ -555,6 +555,7 @@ void bch2_target_to_text(struct printbuf *out, struct bch_fs *c, unsigned v)case TARGET_DEV : {struct bch_dev *ca; + out->atomic++;rcu_read_lock (); ca = t.dev < c->sb.nr_devices ? rcu_dereference(c->devs[t.dev])
@@ -570,6 +571,7 @@ void bch2_target_to_text(struct printbuf *out, struct bch_fs *c, unsigned v) }rcu_read_unlock (); + out->atomic--;break ; }case TARGET_GROUP :
Signature · 1 line
2.40.1
Kent Overstreet
AppliedQuoted 5 lines · Daniel J Blueman
During mount, bcachefs mount option processing may sleep while allocating a string buffer.
Fix this by reference counting in order to take the atomic path.
Signed-off-by Daniel J Blueman <[email protected]>
Thanks, applied