blob: 820acc26844519b683b290c562d8bc3f277cf9ea [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001Upstream-Status: Denied
2[https://www.mail-archive.com/busybox@busybox.net/msg22354.html]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003
4The current behaviour of busybox is to try all fstype when automounting
5even when no media exists. The util-linux mount command bails when no
6media exists, so change the behaviour of busybox to do the same.
7
8It could also be argued that the KERN_INFO message from btrfs could be
9removed, but that would be harder to accomplish.
10
11Signed-off-by: Saul Wold <sgw@linux.intel.com>
12
13
14Index: busybox-1.20.2/util-linux/mount.c
15===================================================================
16--- busybox-1.20.2.orig/util-linux/mount.c
17+++ busybox-1.20.2/util-linux/mount.c
18@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
19 break;
20 errno = errno_save;
21 }
22-
23+ /*
24+ * Break if there is no media, no point retrying for all
25+ * fs types since there is no media available
26+ */
27+ if (rc == -1 && errno == ENOMEDIUM) {
28+ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
29+ }
30 if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
31 break;
32 if (!(vfsflags & MS_SILENT))