svn commit: r272952 - in head/sys: fs/ext2fs fs/msdosfs ufs/ffs

Konstantin Belousov kostikbel at gmail.com
Sun Oct 12 14:20:23 UTC 2014


On Mon, Oct 13, 2014 at 12:39:54AM +1100, Bruce Evans wrote:
> > @@ -627,7 +627,7 @@ ffs_read(ap)
> > 	}
> >
> > 	if ((error == 0 || uio->uio_resid != orig_resid) &&
> > -	    (vp->v_mount->mnt_flag & MNT_NOATIME) == 0 &&
> > +	    (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0 &&
> > 	    (ip->i_flag & IN_ACCESS) == 0) {
> > 		VI_LOCK(vp);
> > 		ip->i_flag |= IN_ACCESS;
> >
> 
> Is it correct for only ffs to acquire the vnode interlock?  I think it
> is, but don't remember which ffs-only feature requires it.

We either hold the vnode lock exclusive, or shared + own the vnode interlock,
for i_flag modifications.  Since this is ffs_read(), which is entered with
the vnode shared locked, the interlock must be acquired.

Both msdosfs and ext2fs do not enable the shared locking mode for
the lockmgr locks serving as the vnodes locks, so msdosfs_read() and
ext2_read() are executed with vnode locked exclusively.


More information about the svn-src-head mailing list