Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fuse: Allow read_folio to retry page fault and read operations
Allow read_folio to return EAGAIN error and translate it to
AOP_TRUNCATE_PAGE to retry page fault and read operations.
This is used to prevent deadlock of folio lock/DLM lock order reversal:
 - Fault or read operations acquire folio lock first, then DLM lock.
 - FUSE daemon blocks new DLM lock acquisition while it invalidating
   page cache. invalidate_inode_pages2_range() acquires folio lock
To prevent deadlock, the FUSE daemon will fail its DLM lock acquisition
with EAGAIN if it detects an in-flight page cache invalidating
operation.

Signed-off-by: Cheng Ding <[email protected]>
(cherry picked from commit 8ecf118)
  • Loading branch information
cding-ddn authored and jianhuangli committed Jul 25, 2025
commit 02eecf926a8e520597d5396e7829e0a7fabb6bcf
5 changes: 4 additions & 1 deletion fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,11 @@ static int fuse_do_readpage(struct file *file, struct page *page)

fuse_read_args_fill(&ia, file, pos, desc.length, FUSE_READ);
res = fuse_simple_request(fm, &ia.ap.args);
if (res < 0)
if (res < 0) {
if (res == -EAGAIN)
res = AOP_TRUNCATED_PAGE;
return res;
}
/*
* Short read means EOF. If file size is larger, truncate it
*/
Expand Down