diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2009-07-29 14:50:31 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2009-07-29 14:50:31 +0000 |
commit | 1aa3b666bcd8f5e11a19afd54894d2325336c753 (patch) | |
tree | 378c6073384d6927765dfa8c3f3d8a35dd52d473 | |
parent | da90e223418123e20164fa14735febb9a81e159b (diff) | |
download | FreeBSD-src-1aa3b666bcd8f5e11a19afd54894d2325336c753.zip FreeBSD-src-1aa3b666bcd8f5e11a19afd54894d2325336c753.tar.gz |
Fix the experimental nfs client so that it only calls ncl_vinvalbuf()
for NFSv2 and not NFSv4 when nfscl_mustflush() returns 0. Since
nfscl_mustflush() only returns 0 when there is a valid write delegation
issued to the client, it only affects the case of an NFSv4 mount with
callbacks/delegations enabled.
Approved by: re (kensmith), kib (mentor)
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 0b224ad..219c62e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -687,11 +687,17 @@ nfs_close(struct vop_close_args *ap) int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); /* np->n_flag &= ~NMODIFIED; */ - } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) { - int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); - /* as above w.r.t. races when clearing NMODIFIED */ - /* np->n_flag &= ~NMODIFIED; */ + } else if (NFS_ISV4(vp)) { + if (nfscl_mustflush(vp)) { + int cm = newnfs_commit_on_close ? 1 : 0; + error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, + cm); + /* + * as above w.r.t races when clearing + * NMODIFIED. + * np->n_flag &= ~NMODIFIED; + */ + } } else error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); mtx_lock(&np->n_mtx); |