-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix request size too large when use direct io
The fuse directio call path is as follows fuse_read_fill+0xa8/0xb0 fuse_send_read+0x3f/0xb0 fuse_direct_io+0x34a/0x5f0 __fuse_direct_read+0x4e/0x70 fuse_file_read_iter+0x9e/0x140 new_sync_read+0xde/0x120 __vfs_read+0x27/0x40 vfs_read+0x94/0x190 ksys_read+0x4e/0xd0 under the direct io path, fuse initiates a request whose request size is determined by the combination of the user-supplied buffer size and max_read mount parameters. size_t nmax = write ? fc->max_write : fc->max_read; size_t count = iov_iter_count(iter); size_t nbytes = min(count, nmax); nres = fuse_send_read(req, io, pos, nbytes, owner); so we have a problem with the checking of the request size in the code, we always compare the request size with MAX_BUFFER_SIZE, but in fact the maximum value of the request size depends on max_read, in virtiofs scenario max_read is UINT_MAX by default, and in fuse scenario it is possible to adjust max_read by the mounting parameter. Signed-off-by: zyfjeff <zyfjeff@linux.alibaba.com>
- Loading branch information
Showing
3 changed files
with
14 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters