use /proc/self/mountinfo and handle a device being mounted in multiple places
authorDavid Zeuthen <davidz@redhat.com>
Thu, 2 Apr 2009 17:54:20 +0000 (13:54 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Thu, 2 Apr 2009 17:54:20 +0000 (13:54 -0400)
commit52443c7793ca55cf53036ecb29a6032e9823b7dd
tree6787c157c4f5405925b1d13fc11307bc0afbe7ef
parent749039bf74a7d560c009daecae8441bd578e33f4
use /proc/self/mountinfo and handle a device being mounted in multiple places

This is an effort to fix

 https://bugzilla.redhat.com/show_bug.cgi?id=491924

Basically we have to somehow cope with a device being mounted in
multiple places. So we replace the property

 String device-mount-path

with an array of mount paths

 String device-mount-paths[]

We also try to make an effort to ensure that the shortest mount point
is shown before others. E.g. if you bind mount / on /foo then

 device-mount-paths = ["/", "/foo"]

This means that desktop clients can just take the first mount path.

Also make a note that this is the mount point in the root
namespace. On systems clients running in other namespaces care has to
be taken; in this case the client probably needs to examine
/proc/self/mountinfo on his own to determine if a given block device
is mounted or not.

Also drop support for the 'remount' option; we might add it back later
but since we now support multiple mount points it makes everything a
bit weird.
12 files changed:
src/devkit-disks-daemon.c
src/devkit-disks-device-private.c
src/devkit-disks-device-private.h
src/devkit-disks-device.c
src/devkit-disks-device.h
src/devkit-disks-mount-file.c
src/devkit-disks-mount-monitor.c
src/devkit-disks-mount-monitor.h
src/devkit-disks-mount.c
src/job-shared.h
src/org.freedesktop.DeviceKit.Disks.Device.xml
tools/devkit-disks.c