Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 2021 15:33:25 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ef23df135468 - main - vfs: set NC_KEEPPOSENTRY alongside NOCACHE when creating a file
Message-ID:  <202101131533.10DFXP6T064604@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=ef23df13546811a49aeebb107dd17298bec8122e

commit ef23df13546811a49aeebb107dd17298bec8122e
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-01-13 14:53:55 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-01-13 15:29:34 +0000

    vfs: set NC_KEEPPOSENTRY alongside NOCACHE when creating a file
    
    Arguably the entire NOCACHE logic should get retired, in the meantime
    at least prevent the code from evicting existing entries.
---
 sys/kern/vfs_vnops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index de5cd68501a7..6c6727c7f372 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -240,8 +240,11 @@ restart:
 		/*
 		 * Set NOCACHE to avoid flushing the cache when
 		 * rolling in many files at once.
-		*/
-		ndp->ni_cnd.cn_flags |= LOCKPARENT | NOCACHE;
+		 *
+		 * Set NC_KEEPPOSENTRY to keep positive entries if they already
+		 * exist despite NOCACHE.
+		 */
+		ndp->ni_cnd.cn_flags |= LOCKPARENT | NOCACHE | NC_KEEPPOSENTRY;
 		if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0)
 			ndp->ni_cnd.cn_flags |= FOLLOW;
 		if ((vn_open_flags & VN_OPEN_INVFS) == 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101131533.10DFXP6T064604>