Skip to content
Commit 1364a3c3 authored by Sarthak Kukreti's avatar Sarthak Kukreti Committed by Jens Axboe
Browse files

block: Don't invalidate pagecache for invalid falloc modes



Only call truncate_bdev_range() if the fallocate mode is supported. This
fixes a bug where data in the pagecache could be invalidated if the
fallocate() was called on the block device with an invalid mode.

Fixes: 25f4c414 ("block: implement (some of) fallocate for block devices")
Cc: stable@vger.kernel.org
Reported-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: default avatarSarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Fixes: line?  I've never seen those wrapped.
Link: https://lore.kernel.org/r/20231011201230.750105-1-sarthakkukreti@chromium.org


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 07a1141f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment