Skip to content
Commit 9539e3b5 authored by Sarthak Kukreti's avatar Sarthak Kukreti Committed by Greg Kroah-Hartman
Browse files

block: Don't invalidate pagecache for invalid falloc modes

commit 1364a3c3 upstream.

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>
Signed-off-by: default avatarSarthak Kukreti <sarthakkukreti@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 079eefae
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