
has busy pages and wants the wapbl lock as reader from wapbl_begin(), another thread has the wapbl lock as reader and waits for a page from the first thread. Now a third thread calls wapbl_flush() and wants the wapbl lock as writer. Move the wapbl_begin() up to a point where genfs_getpages() has no busy pages yet.