From 1964942af0f194287bbdd5dc7ce97399b19f97b7 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 19 Nov 2008 22:45:43 +0000 Subject: [PATCH] Removed special consideration of EBUSY from mountd's auto-mounter. If the SD card is partitioned and one attempts to use a partition of the SD card for another purpose (maybe even booting off of it), then mmcblk0 is considered "busy" when mountd tries to mount it (as specified by /etc/mountd.conf). Normally, it would then attempt to mount partitions of the device, but as "busy" is specially treated in the code it does not consider this to be an error condition. The argment for this check is that "the device is likely already mounted", but that is obviously not something that should be assumed (and is not true in this example situation). Even if the device were already mounted, from the auto-mounter's viewpoint this should be considered an error anyway, as it failed to mount it as it was told. I therefore believe this check to not only be causing the above problem but also to be incorrect. This change removes it. For more information, see this thread: http://groups.google.com/group/android-porting/browse_thread/thread/a67cbe36603d429a --- mountd/AutoMount.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mountd/AutoMount.c b/mountd/AutoMount.c index bfe8ad105..09e97590a 100644 --- a/mountd/AutoMount.c +++ b/mountd/AutoMount.c @@ -254,9 +254,6 @@ static int DoMountDevice(const char* device, const char* mountPoint) if (result == 0) { NotifyMediaState(mountPoint, MEDIA_MOUNTED, (flags & MS_RDONLY) != 0); - } else if (errno == EBUSY) { - // ignore EBUSY, since it usually means the device is already mounted - result = 0; } else { #if CREATE_MOUNT_POINTS rmdir(mountPoint);