From 37fad9497f5d37d89ed06faa64d580d1451be664 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 29 Sep 2023 01:15:33 -0400 Subject: 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 --- fs/bcachefs/bcachefs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/bcachefs.h') diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index e9d07f9fa1c0..53ffa88cae16 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -746,6 +746,7 @@ struct bch_fs { struct snapshot_table __rcu *snapshots; size_t snapshot_table_size; struct mutex snapshot_table_lock; + struct rw_semaphore snapshot_create_lock; struct work_struct snapshot_delete_work; struct work_struct snapshot_wait_for_pagecache_and_delete_work; -- cgit v1.2.3