Skip to content

Commit 46f5cbd

Browse files
dhowellssmfrench
authored andcommitted
cifs: Fix the readahead conversion to manage the batch when reading from cache
Fix the readahead conversion to correctly manage the last batch skipping when reading from cache. This involves a readahead batch of one page or one folio, so set the batch size according to the number of constituent pages (should be 1 for a filesystem that doesn't do multipage folios yet). Signed-off-by: David Howells <[email protected]> cc: Steve French <[email protected]> Reviewed-by: Rohith Surabattula <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 0174ee9 commit 46f5cbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4446,7 +4446,7 @@ static void cifs_readahead(struct readahead_control *ractl)
44464446
* by the cache.
44474447
*/
44484448
page = readahead_page(ractl);
4449-
4449+
last_batch_size = 1 << thp_order(page);
44504450
if (cifs_readpage_from_fscache(ractl->mapping->host,
44514451
page) < 0) {
44524452
/*

0 commit comments

Comments
 (0)