From: Karel Zak <kzak@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: David Chinner <dgc@sgi.com>, lkml <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
util-linux-ng@vger.kernel.org
Subject: Re: [BUG] remount ro on loopback mount leaves unmountable filesystem behind
Date: Wed, 14 May 2008 00:55:58 +0200 [thread overview]
Message-ID: <20080513225558.GU23843@nb.net.home> (raw)
In-Reply-To: <20080513102340.GA15112@infradead.org>
On Tue, May 13, 2008 at 06:23:40AM -0400, Christoph Hellwig wrote:
> On Tue, May 13, 2008 at 06:50:47PM +1000, David Chinner wrote:
> > Same thing, but remounting the loop filesystem readonly
> > before unmounting:
> >
> > $ mount -t xfs /dev/sdb6 /mnt/scratch
> > $ mkdir /mnt/scratch/mnt
> > $ touch /mnt/scratch/img
> > $ mkfs.xfs -f -d file,name=/mnt/scratch/img,size=1g
> > $ mount -t xfs -o loop /mnt/scratch/img /mnt/scratch/mnt
> > $ mount -t xfs -o remount,ro /mnt/scratch/img /mnt/scratch/mnt
> > $ umount /mnt/scratch/mnt
> > $ umount /mnt/scratch
> > umount: /mnt/scratch: device is busy
> > umount: /mnt/scratch: device is busy
>
> This is a problem in mount, no the kernel. Before the remount the
> /etc mtab looks something like this:
>
> /qemu/test.img /mnt xfs rw,loop=/dev/loop0 0 0
>
> and after it looks something like this:
>
> /qemu/test.img /mnt xfs ro 0 0
Yes, that's mount(8) bug. It doesn't read old options from /etc/mtab
when you remount by "mount -o remount <src> <dest>".
> As a workaround do a losetup -d /dev/loop0 after unmounting the
> filesystem.
... or use "mount -o remount <dest>", for example:
mount -t xfs -o remount,ro /mnt/scratch/mnt
Karel
--
Karel Zak <kzak@redhat.com>
prev parent reply other threads:[~2008-05-13 22:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 8:50 [BUG] remount ro on loopback mount leaves unmountable filesystem behind David Chinner
[not found] ` <20080513085047.GY155679365-sJ/iWh9BUns@public.gmane.org>
2008-05-13 10:23 ` Christoph Hellwig
2008-05-13 12:07 ` David Chinner
[not found] ` <20080513120710.GA155679365-sJ/iWh9BUns@public.gmane.org>
2008-05-13 12:42 ` Christoph Hellwig
[not found] ` <20080513124203.GA4806-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2008-05-13 17:10 ` H. Peter Anvin
2008-05-13 22:55 ` 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=20080513225558.GU23843@nb.net.home \
--to=kzak@redhat.com \
--cc=dgc@sgi.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=util-linux-ng@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;
as well as URLs for NNTP newsgroup(s).