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