From owner-freebsd-current@FreeBSD.ORG Tue Apr 27 11:34:45 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 350251065676 for ; Tue, 27 Apr 2010 11:34:45 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7783F8FC14 for ; Tue, 27 Apr 2010 11:34:44 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA12130; Tue, 27 Apr 2010 14:34:22 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4BD6CBBE.3030901@icyb.net.ua> Date: Tue, 27 Apr 2010 14:34:22 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100319) MIME-Version: 1.0 To: Jeff Roberson References: <4BD35437.2060208@lissyara.su> <622DDEDF-0320-49DA-8037-CA8C1F682CC1@samsco.org> <201004251955.03492.bruce@cran.org.uk> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bruce Cran , Alex Keda , freebsd-current@freebsd.org Subject: Re: HEADS UP: SUJ Going in to head today 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, 27 Apr 2010 11:34:45 -0000 on 27/04/2010 09:00 Jeff Roberson said the following: > I think some people are enabling after returning to single user from a > live system rather than booting into single user. This is a different > path in the filesystem as booting directly just mounts read-only while > the other option updates a mount from read/write. I believe this is the > path that is broken. Yes, this seems to be broken and perhaps by design. g_vfs_open() calls g_access like this: g_access(cp, 1, wr, 1); That means that 'e' count (exclusive) is always bumped, even for R/O mounts, and that prevents opening the provider for writing. ffs_mountfs has this special code: /* * If we are a root mount, drop the E flag so fsck can do its magic. * We will pick it up again when we remount R/W. */ if (error == 0 && ronly && (mp->mnt_flag & MNT_ROOTFS)) error = g_access(cp, 0, 0, -1); So, basically for read-only UFS root mount we allow concurrent open, even for writing. This is needed primarily for fsck, but also helps tunefs. But I believe that this code is exercised only during original mount. Remounting to R/O at later time doesn't drop 'e' count. I think that this is by design, to prevent foot-shooting. We either should document this behavior or re-consider it. -- Andriy Gapon