aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfsclient/nfs_clvnops.c
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-12-16 22:30:37 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-12-16 22:30:37 +0000
commit150da1e3cd51e552f7d6bc159b387e540c5a3733 (patch)
tree147a69c30be5204bf5cada267c1009289c3ec804 /sys/fs/nfsclient/nfs_clvnops.c
parenta62478aa05a10cc7881eebea005bafb1ec3ef406 (diff)
downloadsrc-150da1e3cd51e552f7d6bc159b387e540c5a3733.tar.gz
src-150da1e3cd51e552f7d6bc159b387e540c5a3733.zip
nfscl: Partially revert commit 867c27c23a5c
Commit 867c27c23a5c enabled the n_directio_opens code in open/close, which sets/clears NNONCACHE, for IO_APPEND. This code should not be enabled unless newnfs_directio_enable is non-zero. This patch reverts that part of commit 867c27c23a5c. A future patch that fixes the case where the file that is being written IO_APPEND is mmap()'d. MFC after: 3 months
Diffstat (limited to 'sys/fs/nfsclient/nfs_clvnops.c')
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index db2ef26a77c6..ba2ba27b8fb6 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -709,8 +709,8 @@ nfs_open(struct vop_open_args *ap)
/*
* If the object has >= 1 O_DIRECT active opens, we disable caching.
*/
- if (vp->v_type == VREG && ((newnfs_directio_enable && (fmode &
- O_DIRECT)) || (fmode & O_APPEND))) {
+ if (newnfs_directio_enable && (fmode & O_DIRECT) &&
+ (vp->v_type == VREG)) {
if (np->n_directio_opens == 0) {
NFSUNLOCKNODE(np);
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
@@ -967,11 +967,11 @@ nfs_close(struct vop_close_args *ap)
error = nfscl_maperr(ap->a_td, error, (uid_t)0,
(gid_t)0);
}
- if (vp->v_type == VREG && ((newnfs_directio_enable && (fmode &
- O_DIRECT)) || (fmode & O_APPEND))) {
+ if (newnfs_directio_enable)
KASSERT((np->n_directio_asyncwr == 0),
("nfs_close: dirty unflushed (%d) directio buffers\n",
np->n_directio_asyncwr));
+ if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) {
NFSLOCKNODE(np);
KASSERT((np->n_directio_opens > 0),
("nfs_close: unexpectedly value (0) of n_directio_opens\n"));