]> 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 13:03:08 +0000 (14:03 +0100)
commitd5457349e585bd59a0d77a07b7c2dfe6b3bc2b27
tree692b35a9bf527c76d4a8824d2cd846ab9f387850
parent1b9ab6b648f89441c8a13cb3fd8ca83ffebc5262
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