summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-09-29 01:15:33 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:16 -0400
commit37fad9497f5d37d89ed06faa64d580d1451be664 (patch)
treed6d54fcf01befddf0534ca915a3bfb60383e1a38 /fs/bcachefs/super.c
parent1e2d399970ca1d66fa1c715f4d80a0251f2a122e (diff)
downloadlinux-stable-37fad9497f5d37d89ed06faa64d580d1451be664.tar.gz
linux-stable-37fad9497f5d37d89ed06faa64d580d1451be664.tar.bz2
linux-stable-37fad9497f5d37d89ed06faa64d580d1451be664.zip
bcachefs: snapshot_create_lock
Add a new lock for snapshot creation - this addresses a few races with logged operations and snapshot deletion. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 1c775695336d..0e85c22672be 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -720,6 +720,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
mutex_init(&c->bio_bounce_pages_lock);
mutex_init(&c->snapshot_table_lock);
+ init_rwsem(&c->snapshot_create_lock);
spin_lock_init(&c->btree_write_error_lock);