Commit bdd44337 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: loop: don't require ->write_iter for writable files in loop_configure



[ Upstream commit 355341e4 ]

Block devices can be opened read-write even if they can't be written to
for historic reasons.  Remove the check requiring file->f_op->write_iter
when the block devices was opened in loop_configure. The call to
loop_check_backing_file just below ensures the ->write_iter is present
for backing files opened for writing, which is the only check that is
actually needed.

Fixes: f5c84eff ("loop: Add sanity check for read/write_iter")
Reported-by: default avatarChristian Hesse <mail@eworm.de>
Change-Id: Ie3d17da68cb81076f5841f83901a37753f8e10ee
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250520135420.1177312-1-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit cd7f0222)
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 651f2e4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment