From owner-freebsd-current@FreeBSD.ORG Tue Aug 30 16:47:55 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EDF316A420; Tue, 30 Aug 2005 16:47:55 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 551F043D45; Tue, 30 Aug 2005 16:47:55 +0000 (GMT) (envelope-from csjp@FreeBSD.org) Received: from freefall.freebsd.org (csjp@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7UGltFq061507; Tue, 30 Aug 2005 16:47:55 GMT (envelope-from csjp@freefall.freebsd.org) Received: (from csjp@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7UGls0C061506; Tue, 30 Aug 2005 16:47:54 GMT (envelope-from csjp) Date: Tue, 30 Aug 2005 16:47:54 +0000 From: "Christian S.J. Peron" To: Dario Freni Message-ID: <20050830164754.GA53629@freefall.freebsd.org> References: <20050829205638.GA2458@freefall.freebsd.org> <20050829214131.GA2855@freefall.freebsd.org> <43139AC9.50705@freesbie.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43139AC9.50705@freesbie.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-current@FreeBSD.org, pjd@FreeBSD.org Subject: Re: mdconfig recently broken? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 16:47:55 -0000 On Tue, Aug 30, 2005 at 01:31:21AM +0200, Dario Freni wrote: > > -o readonly seems to help: > > # mdconfig -a -t vnode -f usr.uzip > mdconfig: ioctl(/dev/mdctl): Read-only file system > # mdconfig -a -t vnode -o readonly -f usr.uzip > md0 > > Anyway, imho, the readonly option should be automatically set if the > backing store is readonly. Otherwise, this behaviour should be well > documented in mdconfig(8) and/or md(4). > Fixed in revision 1.44 of mdconfig(8) I have included the commit log for your reference: When using files as backing stores for devices, and the user has requested the device be created read+write, check to see if the backing store is read only through the use of the access(2) system call. If this check fails returning EACCES, EPERM or EROFS then gracefully downgrade the access to read only. Also print a warning message to stderr, informing the user that the access mode they requested is not available. This behavior used to be handled by md(4) but was changed in revision 1.154 Discussed with: pjd, phk, Dario Freni Reviewed by: phk -- Christian S.J. Peron csjp@FreeBSD.ORG FreeBSD Committer