Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fs tests failing

On Sat, Sep 01, 2012 at 05:27:27PM -0700, Chuck Silvers wrote:
 > > >our port of ZFS doesn't obey the BSD locking rules.  ZFS doesn't need
 > > >the BSD vnode lock for internal consistency since it does its own locking
 > > >internally, but the above check and possibly others have more recently
 > > >been added to ensure that file systems do the correct locking for the
 > > >fs-independent logic that relies on the BSD vnode lock.
 > > 
 > > Ah, ic, but islocked() comes from genfs.  Given the current
 > > situation, it is more sensible to make VOP_ISLOCKED() return
 > > LK_EXCLUSIVE unconditionally for ZFS and see if that gets DIAGNOSTIC
 > > builds a bit further.
 > no, that's completely wrong.  ZFS's VOP_LOCK() currently doesn't actually
 > lock anything, so having its VOP_ISLOCKED() say that it did is just crazy.
 > all that does is defeat the assertions which are correctly pointing out
 > that ZFS has a bug.
 > if you want to try to improve the situation, change all of the ZFS
 > VOP_*LOCK* to use the genfs ones.  I don't know whether or not that
 > will be sufficient, but it will at least be a step in the right
 > direction.

ZFS has its own, completely different, and incompatible locking
scheme, which is also incorrect (check out its rename...)

The options are:

(1) rip out ZFS's locking scheme and replace it with a traditional one

(2) fix ZFS's locking scheme, teach VFS to interact with it

(3) let ZFS lie to the VFS code and hope it works

both (1) and (2) are huge amounts of work with long-term consequences,
so sticking to (3) until proven nonviable is by far the best
short-term approach.

Also, given what I've seen so far of the ZFS locking, my guess is that
(2) and (1) are in fact more or less the same thing.

David A. Holland

Home | Main Index | Thread Index | Old Index