- milestone: 164970 -->
- labels: 379076 -->
- status: open --> open-accepted
It seems that mount -o remount does not work with mount.crypt mounted crypto devices currently. I guess mount.crypt should check whether remount is given as option and in this case skip the devicemapper creation part and only do the remount for the device mapper device that contains the actual filesystem.
Fedora bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=492347
In v1.21-2-g571cfc2. Ok to release?
Something is not right, yet.
Bug1:
/etc/mtab is wrong. I am not sure, whether this was different before.
# mount -o ro image2 mnt2
Password:
key slot 0 unlocked.
Command successful.
[root@leela pam_mount-test]# mount | grep mnt2
/home/testor/pam_mount-test/image2 on /home/testor/pam_mount-test/mnt2 type crypt (defaults)
[root@leela pam_mount-test]# grep mnt2 /proc/mounts
/dev/mapper/_home_testor_pam_mount_test_image2 /home/testor/pam_mount-test/mnt2 ext3 ro,relatime,errors=continue,data=ordered 0 0
After "mount -o remount image2", /etc/mtab or mount correctly show ro as mount option.
Bug 2&3:
It is not possible to come back from ro to rw. Also after using acl in the remount, every remount after then, the occurences of acl are doubled:
[root@leela pam_mount-test]# mount -o ro image mnt
Password:
key slot 0 unlocked.
Command successful.
[root@leela pam_mount-test]# mount | grep mnt
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (defaults)
[root@leela pam_mount-test]# mount -o remount,acl mnt
mount: blockorientiertes Gerät /home/testor/pam_mount-test/image ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
[root@leela pam_mount-test]# mount | grep mnt
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (ro,acl)
[root@leela pam_mount-test]# mount -o remount,rw mnt
mount: blockorientiertes Gerät /home/testor/pam_mount-test/image ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
[root@leela pam_mount-test]# mount | grep mnt
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (ro,acl,acl)
Since you passed in -o ro with the initial mount command, the loop device is set up as read-only, as is the cryptsetup device, as is the mount. Since remount would not touch loop or crypto devices, the mount cannot be switched to rw. Unfortunately, I cannot run "cryptsetup change" without providing all the cipher etc options again — which are not available at remount time. Similar applies to losetup; while we do have the necessary info, losetup knows no way to switch from ro to rw or vice-versa without destroying the loop device.
use extra_opts in /etc/mtab unless empty
I attached a patch for Bug 1 I noticed here, which makes mount.crypt write "ro" instead of "defaults" in /etc/mtab, if it was specified the first time.
Nevertheless with current git I still see this cosmetic bug:
[root@leela pam_mount-test]# mount image mnt
Password:
key slot 0 unlocked.
Command successful.
[root@leela pam_mount-test]# mount | grep image
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw)
[root@leela pam_mount-test]# mount -o remount,acl mnt
[root@leela pam_mount-test]# mount | grep image
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl)
[root@leela pam_mount-test]# mount -o remount mnt
[root@leela pam_mount-test]# mount | grep image
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl,acl)
[root@leela pam_mount-test]# mount -o remount mnt
[root@leela pam_mount-test]# mount | grep image
/home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl,acl,acl,acl)
Applied.
>Nevertheless with current git I still see this cosmetic bug:
This is a bug of mount(8). You can notice it outside pam_mount too:
mount -i /foo -o remount,acl,acl,acl
mount -i /foo -o remount,acl,acl,acl
and you will have at least 6 acl options in /etc/mtab.
Log in to post a comment.