lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 May 2008 22:07:10 +1000
From:	David Chinner <dgc@....com>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	David Chinner <dgc@....com>, lkml <linux-kernel@...r.kernel.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	util-linux-ng@...r.kernel.org
Subject: Re: [BUG] remount ro on loopback mount leaves unmountable filesystem behind

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
> 
> As a workaround do a losetup -d /dev/loop0 after unmounting the
> filesystem.

Hmmm - I even considered that and tried a '-o remount,ro,loop'
but that obviously doesn't work with dynamic loop device instantiation,
either.

/me didn't read all the way to the bottom of the extremely verbose
mount man page so didn't find the bit about losetup -d....

Anyway, I'll hard code loop device numbers into the script so
I can just forget about this problem. Thanks, Christoph.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ