Linux: detect write protection after opening block devices

Some protected block devices accept writable opens. Check BLKROGET and
report EROFS so the existing mount retry selects read only protection.

Cover automatic detection with read only loop devices on both backends.
This commit is contained in:
Mounir IDRASSI
2026-10-22 11:39:41 +09:00
parent f18a599589
commit d64a29eedc
3 changed files with 39 additions and 2 deletions
+1
View File
@@ -70,6 +70,7 @@
</li>
<li><strong>Linux:</strong>
<ul>
<li>Automatically mount volumes as read only when the backing block device reports write protection, even if it permits an open request with write access.</li>
<li>Forward sync requests for volumes mounted through FUSE to the backing file or device and report flush failures. Previously, a successful sync could leave data in the host cache.</li>
<li>Check that devices belong to the selected volume before dismount or filesystem checks. Leave externally supplied host devices attached and refuse normal dismount while a decrypted loop device remains in use.</li>
<li>Support writable volume files on shares that restrict root access, including GVfs and NFS with <code>root_squash</code> (GH #23). Keep the share mounted and the user session active until dismount.</li>