aboutsummaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2022-03-03 13:05:18 +0000
committerLinus Torvalds <[email protected]>2022-03-03 11:35:21 -0800
commitb08968f196d498b19e9d0841d76a03862258f2d8 (patch)
treed4149e996a676d087f9b0ff8417c1345de2abb18 /net/switchdev/switchdev.c
parentb949c21fc23ecaccef89582f251e6281cad1f81e (diff)
cachefiles: Fix incorrect length to fallocate()
When cachefiles_shorten_object() calls fallocate() to shape the cache file to match the DIO size, it passes the total file size it wants to achieve, not the amount of zeros that should be inserted. Since this is meant to preallocate that amount of storage for the file, it can cause the cache to fill up the disk and hit ENOSPC. Fix this by passing the length actually required to go from the current EOF to the desired EOF. Fixes: 7623ed6772de ("cachefiles: Implement cookie resize for truncate") Reported-by: Jeffle Xu <[email protected]> Signed-off-by: David Howells <[email protected]> Tested-by: Jeff Layton <[email protected]> Reviewed-by: Jeff Layton <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/164630854858.3665356.17419701804248490708.stgit@warthog.procyon.org.uk # v1 Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions