]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: Don't allow an atomic write be truncated in blkdev_write_iter()
authorJohn Garry <john.g.garry@oracle.com>
Wed, 27 Nov 2024 09:23:18 +0000 (09:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:32 +0000 (13:54 +0100)
commit7ef523e499ef95f43da8285998b7914f6a3ca2c6
treed98f503cd2a474474f73adf4aced07370f845f21
parent4b216c8f9c7d84ef7de33ca60b97e08e03ef3292
block: Don't allow an atomic write be truncated in blkdev_write_iter()

[ Upstream commit 2cbd51f1f8739fd2fdf4bae1386bcf75ce0176ba ]

A write which goes past the end of the bdev in blkdev_write_iter() will
be truncated. Truncating cannot tolerated for an atomic write, so error
that condition.

Fixes: caf336f81b3a ("block: Add fops atomic write support")
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241127092318.632790-1-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/fops.c