Launchpad has imported 4 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=54487.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2012-09-04T09:30:02+00:00 Martin Pitt wrote:

When you have an udisks mount and shut down the computer, or just udisks
(during a package upgrade, or due to a crash), the mount point (in
/media/ or /run/media/user/) is not automatically cleaned up. This is
not such a big deal for mount points in /run, but upstream supports the
/media/ case as well, and for long-running systems the "clean /run on
boot" only helps to some degree as well.

calculate_mount_point() only checks whether a mount point already
exists, not if there is something mounted on it already. So in above
situations, you end up with an unused /run/media/user/mylabel/, and the
device is instead mounted to /run/media/user/mylabel1/.

I think it would be better to check G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT
if the directory already exists, and re-use it if it's not a mount point
and the directory is empty. An easier implementation might be to try and
g_remove() the mount point, which will fail if it is non-empty or
mounted. If that succeeds, we re-create the mountpoint with up-to-date
permissions.

Reply at: https://bugs.launchpad.net/udisks/+bug/1043772/comments/5

------------------------------------------------------------------------
On 2012-09-04T10:58:09+00:00 Martin Pitt wrote:

Created attachment 66602
patch and test case

This adds a test case and a fix. OK to push?

Reply at: https://bugs.launchpad.net/udisks/+bug/1043772/comments/6

------------------------------------------------------------------------
On 2012-09-04T16:19:19+00:00 Zeuthen wrote:

I don't think this is a good idea - the directory could have been
created by the user for e.g. an /etc/fstab mount point.

Just use /run/media or put /media on tmpfs and you won't have this
problem.

Reply at: https://bugs.launchpad.net/udisks/+bug/1043772/comments/8

------------------------------------------------------------------------
On 2012-09-05T03:39:13+00:00 Martin Pitt wrote:

> Just use /run/media or put /media on tmpfs and you won't have this
problem.

You'd have it less, but it's still an issue on long-running systems.

So if we don't use rmdir() but instead add a "is mountpoint" and "is
empty" test, would you be ok with that?

Reply at: https://bugs.launchpad.net/udisks/+bug/1043772/comments/9


** Changed in: udisks
       Status: Unknown => In Progress

** Changed in: udisks
   Importance: Unknown => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1043772

Title:
  disk auto-mounter leaves unused directories in /media/<user>

To manage notifications about this bug go to:
https://bugs.launchpad.net/udisks/+bug/1043772/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to