[git commit] mount: do not guess bind mounts as nfs

Denys Vlasenko vda.linux at googlemail.com
Wed Dec 2 18:10:22 UTC 2020


commit: https://git.busybox.net/busybox/commit/?id=b4f93f562d261a163113cd15cc252c53d2fa27bb
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Fails as follows:

$ mount -o bind /dev/disk/by-path/pci-0000:13:00.0-scsi-0:0:3:0 /dir
mount: bad address '/dev/disk/by-path/pci-0000'

function                                             old     new   delta
singlemount                                         1256    1273     +17

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/mount.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util-linux/mount.c b/util-linux/mount.c
index cfb6b570f..dba583544 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -2066,6 +2066,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
 	// Might this be an NFS filesystem?
 	if ((!mp->mnt_type || is_prefixed_with(mp->mnt_type, "nfs"))
 	 && strchr(mp->mnt_fsname, ':') != NULL
+	 && !(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))
 	) {
 		if (!mp->mnt_type)
 			mp->mnt_type = (char*)"nfs";


More information about the busybox-cvs mailing list