summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/fs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-11-11 12:33:12 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:46 -0400
commiteb8e6e9ccbb4ba37c04a7cff032975b4df7d63c7 (patch)
tree946041b0c3ce44e48e4968840527b11e2d1c25d8 /fs/bcachefs/fs.h
parent6d9378f3dcd7b91effdc4ffe1da1a2e8987e9f1e (diff)
downloadlinux-eb8e6e9ccbb4ba37c04a7cff032975b4df7d63c7.tar.gz
linux-eb8e6e9ccbb4ba37c04a7cff032975b4df7d63c7.tar.bz2
linux-eb8e6e9ccbb4ba37c04a7cff032975b4df7d63c7.zip
bcachefs: Deadlock prevention for ei_pagecache_lock
In the dio write path, when get_user_pages() invokes the fault handler we have a recursive locking situation - we have to handle the lock ordering ourselves or we have a deadlock: this patch addresses that by checking for locking ordering violations and doing the unlock/relock dance if necessary. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.h')
-rw-r--r--fs/bcachefs/fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/fs.h b/fs/bcachefs/fs.h
index b3a2993dd9bc..7c095b856b05 100644
--- a/fs/bcachefs/fs.h
+++ b/fs/bcachefs/fs.h
@@ -26,6 +26,7 @@ static inline void pagecache_lock_init(struct pagecache_lock *lock)
}
void bch2_pagecache_add_put(struct pagecache_lock *);
+bool bch2_pagecache_add_tryget(struct pagecache_lock *);
void bch2_pagecache_add_get(struct pagecache_lock *);
void bch2_pagecache_block_put(struct pagecache_lock *);
void bch2_pagecache_block_get(struct pagecache_lock *);