Skip to content

Commit

Permalink
cachefiles: Set the max subreq size for cache writes to MAX_RW_COUNT
Browse files Browse the repository at this point in the history
[ Upstream commit 51d3798 ]

Set the maximum size of a subrequest that writes to cachefiles to be
MAX_RW_COUNT so that we don't overrun the maximum write we can make to the
backing filesystem.

Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
cc: Jeff Layton <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
dhowells authored and gregkh committed Sep 12, 2024
1 parent cae59df commit cec226f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cachefiles/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static void cachefiles_prepare_write_subreq(struct netfs_io_subrequest *subreq)

_enter("W=%x[%x] %llx", wreq->debug_id, subreq->debug_index, subreq->start);

subreq->max_len = ULONG_MAX;
subreq->max_len = MAX_RW_COUNT;
subreq->max_nr_segs = BIO_MAX_VECS;

if (!cachefiles_cres_file(cres)) {
Expand Down

0 comments on commit cec226f

Please sign in to comment.