mountall: potential problem with fuse.ceph

Bug #1588594 reported by Francois Lafont
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mountall (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

Here is a perfectly valid fstab line to mount a fuse.ceph filesystem (it's a distributed file system but no importance here):

    id=cfs,keyring=/etc/ceph/keyring,client_mountpoint=/ /mnt/ fuse.ceph defaults,_netdev 0 0

But here are the arguments given to /sbin/mount.fuse.ceph by mountall:

    id=cfs,keyring=/etc/ceph/keyring,client_mountpoint= /mnt -o rw,_netdev

As you can see, I have "client_mountpoint=" but it should be "client_mountpoint=/" (with the / at the end). The trailing "/" has been removed and in this case it's a bad idea. The mount at boot just fails because "client_mountpoint=" is not correct.

In fact, the problem is in src/mountall.c around line 569:

    char *colon;
    dequote (mnt->device);
    /* If our device name is in host:/path format, as is
     * commonly used for network filesystems, don't strip
     * trailing slashes if this is the entire path. We
     * look for the colon starting from the end, so that
     * we correctly handle IPv6 addresses for the host
     * part.
     */
    if ((colon = strrchr (mnt->device,':')) != NULL
        && colon[1] == '/')
        strip_slashes (colon + 2);
    else
        strip_slashes (mnt->device); // <==== bad idea in the specific case of fuse.ceph filesystem

It's Ubuntu Xenial with mountall version 2.54ubuntu1.

Regards

Revision history for this message
Francois Lafont (francois-lafont) wrote :

In fact, the problem is not really embarassing in Ubuntu Xenial because mountall is not used by default to mount the filesystems from fstab. But, for instance, it's really embarassing in Ubuntu Trusty because:

1. the problem is present in Ubuntu Trusty too (the code C is the same on this part),
2. by default, mountall is used in Ubuntu Trusty to mount the file system from fstab at boot.

PS: of course, a workaround possible is to _not_ put "client_mountpoint=/" at the end like in:

id=cfs,client_mountpoint=/,keyring=/etc/ceph/keyring /mnt/ fuse.ceph defaults,_netdev 0 0

which is a valid fstab line too.

Revision history for this message
AnrDaemon (anrdaemon) wrote :

mountall is used by Xenial, if you switch to upstart.

Revision history for this message
Francois Lafont (francois-lafont) wrote :

Ah ok, thx.

Personally I'm not used to changing the init program of my distrib but indeed it's possible. So the problem can happen in Trusty and in Xenial too with the condition to switch to upstart in the Xenial case.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1588594] Re: mountall: potential problem with fuse.ceph

On Fri, Jun 03, 2016 at 04:50:15PM -0000, Francois Lafont wrote:
> Personally I'm not used to changing the init program of my distrib but
> indeed it's possible. So the problem can happen in Trusty and in Xenial
> too with the condition to switch to upstart in the Xenial case.

Running xenial with upstart is not a supported configuration; upstart is
supported in xenial only during the upgrade until the first reboot.

Revision history for this message
Francois Lafont (francois-lafont) wrote :

Ah ok. In any case, the "mountall" package has potentially a bad behavior with valid fuse.ceph fstab lines.

In Trusty, it's really a problem because by default Trusty uses upstart which uses mountall to mount filesystems in fstab. For the other distribution, I don't know. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.