From: Eric Werme USG (werme@zk3.dec.com)
Date: 06/19/01-02:12:18 PM Z
From: Eric Werme USG <werme@zk3.dec.com>
Message-Id: <200106191912.PAA0001030511@anw.zk3.dec.com>
Subject: Re: SETATTR and guard
Date: Tue, 19 Jun 2001 15:12:18 -0400
Spencer Emailed me:
Would you mind sharing with the NFSv4 WG what your OS does with
respect to atomicity between the guard check and SETATTR?
The VOP_ calls the Tru64 server makes for a guarded setattr are:
VOP_RWLOCK(vp, 1, lerror);
VOP_GETATTR(vp, &bva, u.u_cred, bverror);
if (args->guard.check) {
[check guard data, error out if mismatch]
}
VOP_SETATTR(vp, &ava, u.u_cred, error);
VOP_FSYNC(vp, FWRITE | FWRITE_METADATA, u.u_cred, MNT_WAIT, error);
VOP_GETATTR(vp, &ava, u.u_cred, averror);
done:
VOP_RWUNLOCK(vp, 1, lerror);
The RWLOCK/RWUNLOCK stuff was added for this and to make the pre & post
op attributes accurate for writes and the other ops that use weak
cache consistancy.
Warts:
UFS supports RWLOCK/RWUNLOCK, AdvFS doesn't. Every so often they notice
that and mutter about implementing it. If RWLOCK fails, we don't
return pre-op attributes.
We don't use it with write gathering as several writes over time get
mashed together and the file would be locked for quite a while. (That
may be a bogus argument.) We don't return pre-op attributes on gathered
writes either.
Local VFS calls (write(2), etc) don't call RWLOCK, so we only support
the guarded setattr well in a pure NFS server environment.
I haven't heard complaints about the warts, so I haven't pushed to clean
them up.
-Ric Werme
This archive was generated by hypermail 2.1.2 : 03/04/05-01:48:51 AM Z CST