]> git.itanic.dy.fi Git - linux-stable/commit
xen/blkfront: Only check REQ_FUA for writes
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 26 Apr 2023 16:40:05 +0000 (17:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 13:38:57 +0000 (15:38 +0200)
commit1ba0925b48205e06c913db2da46d5abbda0b2bbb
tree3cf4e43876638b6b14aafa4a11b7a9f97a0d0fd1
parent9a592589a30e8565d22b754e88dd86429eced2c1
xen/blkfront: Only check REQ_FUA for writes

[ Upstream commit b6ebaa8100090092aa602530d7e8316816d0c98d ]

The existing code silently converts read operations with the
REQ_FUA bit set into write-barrier operations. This results in data
loss as the backend scribbles zeroes over the data instead of returning
it.

While the REQ_FUA bit doesn't make sense on a read operation, at least
one well-known out-of-tree kernel module does set it and since it
results in data loss, let's be safe here and only look at REQ_FUA for
writes.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20230426164005.2213139-1-ross.lagerwall@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/xen-blkfront.c