Description of problem: 'mount --rbind --make-rslave <src> <dst>' does not behave the same as 'mount --rbind <src> <dst>; mount --make-rslave <dst>' Version-Release number of selected component (if applicable): 2.32.2.fc28 How reproducible: Consistently Steps to Reproduce: 1. mkdir -p /sysroot/dev 2. mount --rbind --make-rslave /dev /sysroot/dev mount | grep sysroot umount -l /sysroot/dev 3. mount --rbind /dev /sysroot/dev mount --make-rslave /sysroot/dev mount | grep sysroot umount -l /sysroot/dev Actual results for step 2: devtmpfs on /sysroot/dev type devtmpfs (rw,nosuid,seclabel,size=4063476k,nr_inodes=1015869,mode=755) Expected results for step 2: devtmpfs on /sysroot/dev type devtmpfs (rw,nosuid,seclabel,size=4063476k,nr_inodes=1015869,mode=755) tmpfs on /sysroot/dev/shm type tmpfs (rw,nosuid,nodev,seclabel) devpts on /sysroot/dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) hugetlbfs on /sysroot/dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M) mqueue on /sysroot/dev/mqueue type mqueue (rw,relatime,seclabel) Additional info: The difference in behaviour does not strike me as obvious. It would be less surprising if both sequences had the same effect. If working as designed, I would be interested in knowing the rationale.
Good catch. It's bug. Fixed by upstream commits: 4ebea84bb1ca6b0fa817588aba13de26c8d5e5a0 816773b475900909d42c2c8282a6ac50252cac22 # strace -e mount mount --rbind --make-rslave /mnt/A /mnt/B Old version: mount("/mnt/A", "/mnt/B", 0x13ecac0, MS_MGC_VAL|MS_BIND, NULL) = 0 mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0 Fixed version: mount("/mnt/A", "/mnt/B", 0x1f22ac0, MS_MGC_VAL|MS_BIND|MS_REC, NULL) = 0 mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0
The change will be available in v2.33.