dissect: ext4 and loopback files are unimpressed by read-only access
authorLennart Poettering <lennart@poettering.net>
Mon, 19 Apr 2021 20:47:33 +0000 (22:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 May 2021 12:51:08 +0000 (14:51 +0200)
commit8c7bc71e772899a401b377711b63de32a67c951d
treed4514154758303b31b637073a56cae5df25b333e
parentb3b84982d0e72d3160ff7ecb6193c6439c1fc27e
dissect: ext4 and loopback files are unimpressed by read-only access

Even if we set up a loopback device read-only and mount it read-only
this means nothing, ext4 will still write through to the backing storage
file.

Yes, I lost 6h debugging time on this.

Apparently, we have to specify "norecovery" when mounting such file
systems, to force them into truly read-only mode. Let's do so.

(cherry picked from commit b620bf332f575ba9b8e4cd60c93446a0c35c23e8)
src/shared/dissect-image.c