Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | Upstream-Status: Denied |
| 2 | [https://www.mail-archive.com/busybox@busybox.net/msg22354.html] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 3 | |
| 4 | The current behaviour of busybox is to try all fstype when automounting |
| 5 | even when no media exists. The util-linux mount command bails when no |
| 6 | media exists, so change the behaviour of busybox to do the same. |
| 7 | |
| 8 | It could also be argued that the KERN_INFO message from btrfs could be |
| 9 | removed, but that would be harder to accomplish. |
| 10 | |
| 11 | Signed-off-by: Saul Wold <sgw@linux.intel.com> |
| 12 | |
| 13 | |
| 14 | Index: 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)) |