diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-15 21:44:32 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:48 -0400 |
commit | e242b92af5ef74cdf40b237c9e904034c081b144 (patch) | |
tree | ba951dcacf44a1d42b309c72d536dca9b0846e3a /fs/bcachefs/errcode.h | |
parent | 67ace2724603378fec0c5321736e2772d459fd8c (diff) | |
download | linux-e242b92af5ef74cdf40b237c9e904034c081b144.tar.gz linux-e242b92af5ef74cdf40b237c9e904034c081b144.tar.bz2 linux-e242b92af5ef74cdf40b237c9e904034c081b144.zip |
bcachefs: Fix for long running btree transactions & key cache
While a btree transaction is running, we hold a SRCU read lock on the
btree key cache that prevents btree key cache keys from being freed -
this is so that relock() operations won't access freed memory.
The downside of this is that long running btree transactions prevent
memory from being freed from the key cache. This adds a check in
bch2_trans_begin() - if the transaction has been running longer than 1
second, drop and retake the SRCU read lock and zero out pointers to
unlock key cache paths.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/errcode.h')
-rw-r--r-- | fs/bcachefs/errcode.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index dc388864be6f..5f0f75726784 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -53,6 +53,7 @@ x(BCH_ERR_no_btree_node, no_btree_node_down) \ x(BCH_ERR_no_btree_node, no_btree_node_init) \ x(BCH_ERR_no_btree_node, no_btree_node_cached) \ + x(BCH_ERR_no_btree_node, no_btree_node_srcu_reset) \ x(0, btree_insert_fail) \ x(BCH_ERR_btree_insert_fail, btree_insert_btree_node_full) \ x(BCH_ERR_btree_insert_fail, btree_insert_need_mark_replicas) \ |