Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 May 2009 22:25:42 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Jaakko Heinonen <jh@saunalahti.fi>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: VOP_WRITE & read-only file system
Message-ID:  <20090528192542.GB1927@deviant.kiev.zoral.com.ua>
In-Reply-To: <20090528172943.GA3859@a91-153-125-115.elisa-laajakaista.fi>
References:  <20090527150258.GA3666@a91-153-125-115.elisa-laajakaista.fi> <20090527153543.GK1927@deviant.kiev.zoral.com.ua> <20090528172943.GA3859@a91-153-125-115.elisa-laajakaista.fi>

next in thread | previous in thread | raw e-mail | index | archive | help

--p4lCLMlDzlgb3GqX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, May 28, 2009 at 08:29:43PM +0300, Jaakko Heinonen wrote:
>=20
> Hi,
>=20
> On 2009-05-27, Kostik Belousov wrote:
> > > 1) mmap(2)
> > >   - mmap(2) a file
> > >   - close(2) the file handle
> > >   - remount file-system as read-only
> > >   - modify mapped memory
>=20
> > Yes, the issue is there. Real cause for the problem is that mmap() does
> > not increment v_writecnt of the vnode that backs shared writable mappin=
gs.
> >=20
> > I have a patch that fixes this, see
> > http://people.freebsd.org/~kib/misc/vm_map_delete.3.patch
>=20
> The patch seems to have a problem with forced remount or unmount. After
> a forced remount to read-only munmap(2) crashes in _vm_map_unlock()
> due to NULL vp.
>=20
> #12 0xc08f0cb3 in _vn_lock (vp=3D0x0, flags=3D525312,=20
>     file=3D0xc0c55e8f "/home/jaakko/src/head/sys/vm/vm_map.c", line=3D494)
>     at vnode_if.h:830
> #13 0xc0a8cb4f in _vm_map_unlock (map=3D0xc634f000, process_freelist=3D1,=
=20
>     file=3D0xc0c56902 "/home/jaakko/src/head/sys/vm/vm_mmap.c", line=3D59=
7)
>     at /home/jaakko/src/head/sys/vm/vm_map.c:494
> #14 0xc0a91d98 in munmap (td=3D0xc5a996c0, uap=3D0xf480ecf8)
>     at /home/jaakko/src/head/sys/vm/vm_mmap.c:597
> #15 0xc0b637b3 in syscall (frame=3D0xf480ed38)
>     at /home/jaakko/src/head/sys/i386/i386/trap.c:1073
> #16 0xc0b46a10 in Xint0x80_syscall ()
>     at /home/jaakko/src/head/sys/i386/i386/exception.s:261

I expect that
http://people.freebsd.org/~kib/misc/vm_map_delete.4.patch
fix the issue.

--p4lCLMlDzlgb3GqX
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkoe5TUACgkQC3+MBN1Mb4g6DQCeOBxmZ/zOeCtzdoApYGyTcSmM
/N4AoLAfi4Sf1+CUZ7zDgLsaG2DvzNzC
=MMtG
-----END PGP SIGNATURE-----

--p4lCLMlDzlgb3GqX--



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