My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 18419: system/core/toolbox/mount.c
2 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Jul 2011


Sign in to add a comment
 
Reported by arpruss, Jul 11, 2011
The toolbox mount command incorrectly checks for errors when starting up a loop device.  The code reads

        file_fd = open(dev, flags);
        if (file_fd < -1) {
            perror("open backing file failed");
            return 1;
        }
        device_fd = open(loopdev, flags);
        if (device_fd < -1) {
            perror("open loop device failed");
            close(file_fd);
            return 1;
        }

The -1 needs to be replaced by zero on both if lines.  We don't want to be opening loopdev if opening dev failed.


While one's at it, it would be nice to add support for -oloop=/device , thereby fixing the "FIXME" comment in the file about how only one loop device is supported.
Jul 11, 2011
#1 fadden%a...@gtempaccount.com
That does look wrong.  Internal bug 5016882.
Status: Reviewed
Jul 14, 2011
#2 fadden%a...@gtempaccount.com
Notes from internal bug:

-----
The -1 was replaced by 0 in both places, and a similar fix was also made in the umount command.

The old mount option "-o loop" still works and defaults to device /dev/block/loop0 like it always has.

The new option "-o loop=<loopback device file>" is now supported, and the umount command has been updated to automatically undo the loopback mapping to the backing store file when unmounting such a filesystem.
-----

Status: FutureRelease
Jun 23, 2013
#3 jbq@android.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting