Date: Tue, 10 Sep 2002 15:46:05 -0700 (PDT) From: Don Lewis <dl-freebsd@catspoiler.org> To: current@FreeBSD.ORG, jeff@FreeBSD.ORG Cc: Robert Watson <rwatson@FreeBSD.ORG> Subject: vnode lock assertion problem in nfs_rename() Message-ID: <200209102246.g8AMk5wr096324@gw.catspoiler.org> In-Reply-To: <200209092300.g89N0Hwr093398@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 9 Sep, Don Lewis wrote:
> nfs_link() contains the following code:
>
> /*
> * Push all writes to the server, so that the attribute cache
> * doesn't get "out of sync" with the server.
> * XXX There should be a better way!
> */
> VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_thread);
>
> The problem is that vp is not locked by the caller, but VOP_FSYNC()
> expects its argument to be locked.
>
> I think we can probably just lock and unlock vp around the call to
> VOP_FSYNC() ...
There's a similar problem in nfs_rename():
/*
* We have to flush B_DELWRI data prior to renaming
* the file. If we don't, the delayed-write buffers
* can be flushed out later after the file has gone stale
* under NFSV3. NFSV2 does not have this problem because
* ( as far as I can tell ) it flushes dirty buffers more
* often.
*/
VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_thread);
if (tvp)
VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_thread);
fvp is not locked by the caller.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209102246.g8AMk5wr096324>
