On 25/05/20 05:49AM, hch@xxxxxxxxxxxxx wrote: > On Tue, May 20, 2025 at 02:46:22PM +0200, Christian Hesse wrote: > > "Xu, Lizhi" <Lizhi.Xu@xxxxxxxxxxxxx> on Tue, 2025/05/20 12:27: > > > If it is a regular file, generic_ro_fops is used. In this case, > > > isofs supports read_iter. When a regular file has a writable attribute, > > > > Just tested with an iso file where writable flag from loopback file inside > > was explicitly removed. No change. > > > > > the problem will recur because isofs does not support write_iter. > > > > We have two indications here that setup should happen in read-only mode: > > > > * The underlaying filesystem is read-only > > * `losetup` is called with switch `--read-only` > > > > I would expect both to make this happy. > > Can you test this patch? > > We historically allow a writable fd on block devices even when they > are read-only. I suspect your use case is doing that and the new > check for write_iter is interfering with that: I have tested the patch and can confirm that it fixes the usecase as represented by the reproducer that I have used to bisect the bug. If you turn this into an actual patch you can add my Tested-by: Christian Heusel <christian@xxxxxxxxx> if you want :)
Attachment:
signature.asc
Description: PGP signature