Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Alex Deymo <deymo@chromium.org>
Cc: util-linux@vger.kernel.org
Subject: Re: umount --detach-loop fails but fs is unmounted
Date: Fri, 3 Apr 2015 12:06:47 +0200	[thread overview]
Message-ID: <20150403100647.GC3923@ws.net.home> (raw)
In-Reply-To: <CAGd9gwi86agrHS3HgFixjZGD3bYjoFabai3G856qw9Rwfo7W-A@mail.gmail.com>

On Fri, Mar 27, 2015 at 12:03:26PM -0700, Alex Deymo wrote:
> I'm running into a problem when using -d in umount. I'm using
> util-linux 2.25.1, but didn't see changes in that code in ToT. When
> calling "umount -d" if the passed argument is *not* a loop device (for
> example /dev/loopX or /mnt/foo/bar), it will umount it, but the
> command will fail (return != 0) and print EINVAL error (22).
> Documentation says:
> 
>   -d, --detach-loop
>     When the unmounted device was a loop device, also free this loop device.
> 
> So the command shouldn't fail if you didn't pass a loop device but
> still used -d; right? Is this a problem in the documentation or the
> code?
> 
> * Examples: if you mount your ${image} (an ext4 fs, but whatever) in
> ${mount_point} this way:
> 
>   loop_device=$(sudo losetup --find --show ${image})
>   sudo mount -o rw ${loop_device} ${mount_point}
> 
> 
> The following command fails (error code 1) and does NOT remove the
> loop device, but unmounts the fs properly:
>   sudo umount -d ${mount_point}
> umount: ${mount_point}: filesystem was unmounted, but mount(8) failed:
> Invalid argument

I'm not able to reproduce this problem.

        # rpm -q util-linux
        util-linux-2.25.2-2.fc21.x86_64

        # losetup --find --show /home/archive/fs-images/filesystems/ext2.img
        /dev/loop0

        # mount /dev/loop0 /mnt/test

        # losetup 
        NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
        /dev/loop0         0      0         0  0 /home/archive/fs-images/filesystems/ext2.img

        # findmnt /mnt/test
        TARGET    SOURCE     FSTYPE OPTIONS
        /mnt/test /dev/loop0 ext3   rw,relatime,seclabel,data=ordered

        # umount -d /mnt/test
        # echo $?
        0

Please, try

   LIBMOUNT_DEBUG=0xffff umount -d ${mount_point}

or/and strace output would be also nice.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

      reply	other threads:[~2015-04-03 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 19:03 umount --detach-loop fails but fs is unmounted Alex Deymo
2015-04-03 10:06 ` Karel Zak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150403100647.GC3923@ws.net.home \
    --to=kzak@redhat.com \
    --cc=deymo@chromium.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox