summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/error.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-06-15 20:58:47 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:08:41 +0200
commit1ada160618d66bc57beacb4c35f13e9a4c269afa (patch)
treeda5f9d4111d5b12bac49a3b53faac7609c331aa1 /fs/bcachefs/error.c
parentbcachefs: Add an internal option for reading entire journal (diff)
downloadlinux-1ada160618d66bc57beacb4c35f13e9a4c269afa.tar.xz
linux-1ada160618d66bc57beacb4c35f13e9a4c269afa.zip
bcachefs: Turn c->state_lock into an rwsem
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r--fs/bcachefs/error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c
index 1662a36244cd..cd46706fb6f5 100644
--- a/fs/bcachefs/error.c
+++ b/fs/bcachefs/error.c
@@ -37,7 +37,7 @@ void bch2_io_error_work(struct work_struct *work)
struct bch_fs *c = ca->fs;
bool dev;
- mutex_lock(&c->state_lock);
+ down_write(&c->state_lock);
dev = bch2_dev_state_allowed(c, ca, BCH_MEMBER_STATE_RO,
BCH_FORCE_IF_DEGRADED);
if (dev
@@ -47,7 +47,7 @@ void bch2_io_error_work(struct work_struct *work)
bch_err(ca,
"too many IO errors, setting %s RO",
dev ? "device" : "filesystem");
- mutex_unlock(&c->state_lock);
+ up_write(&c->state_lock);
}
void bch2_io_error(struct bch_dev *ca)