diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-29 23:11:08 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-02 10:24:34 -0400 |
| commit | dcffc3b1ae3251d796a25c673f614e3099ca83d3 (patch) | |
| tree | 7b5a5ada3f5ca8e5bda8ab38a396f2c3730fd792 /fs/bcachefs/chardev.c | |
| parent | bcachefs: fix ref leak in btree_node_read_all_replicas (diff) | |
| download | linux-dcffc3b1ae3251d796a25c673f614e3099ca83d3.tar.gz linux-dcffc3b1ae3251d796a25c673f614e3099ca83d3.zip | |
bcachefs: Split up bch_dev.io_ref
We now have separate per device io_refs for read and write access.
This fixes a device removal bug where the discard workers were still
running while we're removing alloc info for that device.
It's also a bit of hardening; we no longer allow writes to devices that
are read-only.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/chardev.c')
| -rw-r--r-- | fs/bcachefs/chardev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/chardev.c b/fs/bcachefs/chardev.c index 584f4a3eb670..c9d1585eec21 100644 --- a/fs/bcachefs/chardev.c +++ b/fs/bcachefs/chardev.c @@ -615,7 +615,7 @@ static long bch2_ioctl_disk_get_idx(struct bch_fs *c, for_each_online_member(c, ca) if (ca->dev == dev) { - percpu_ref_put(&ca->io_ref); + percpu_ref_put(&ca->io_ref[READ]); return ca->dev_idx; } |
