From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [BUG] remount ro on loopback mount leaves unmountable filesystem behind Date: Tue, 13 May 2008 10:10:35 -0700 Message-ID: <4829CB8B.1000500@zytor.com> References: <20080513085047.GY155679365@sgi.com> <20080513102340.GA15112@infradead.org> <20080513120710.GA155679365@sgi.com> <20080513124203.GA4806@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Chinner , lkml , linux-fsdevel , util-linux-ng-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Christoph Hellwig Return-path: In-Reply-To: <20080513124203.GA4806-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Sender: util-linux-ng-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org Christoph Hellwig wrote: > On Tue, May 13, 2008 at 10:07:10PM +1000, David Chinner wrote: >> Anyway, I'll hard code loop device numbers into the script so >> I can just forget about this problem. Thanks, Christoph. > > hardcoding them is a little dangerous because a system might aswell > have them in use already, e.g. for CD images. Just use losetup -f to > find the first free one and keep it in a shell variable. losetup -f is racy, too. losetup -sf is safe, however. -hpa -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html