Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 2010 14:34:22 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Jeff Roberson <jroberson@jroberson.net>
Cc:        Bruce Cran <bruce@cran.org.uk>, Alex Keda <admin@lissyara.su>, freebsd-current@freebsd.org
Subject:   Re: HEADS UP: SUJ Going in to head today
Message-ID:  <4BD6CBBE.3030901@icyb.net.ua>
In-Reply-To: <alpine.BSF.2.00.1004261959480.1398@desktop>
References:  <4BD35437.2060208@lissyara.su>	<alpine.BSF.2.00.1004241656270.1398@desktop>	<622DDEDF-0320-49DA-8037-CA8C1F682CC1@samsco.org>	<201004251955.03492.bruce@cran.org.uk> <alpine.BSF.2.00.1004261959480.1398@desktop>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BD6CBBE.3030901>