Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: Fix directory delegation verifier checks

Doing this check in nfs_check_verifier() resulted in many, many more
lookups on the wire when running Christoph's delegation benchmarking
script. After some experimentation, I found that we can treat directory
delegations exactly the same as having a delegated verifier when we
reach nfs4_lookup_revalidate() for the best performance.

Reported-by: Christoph Hellwig <hch@lst.de>
Fixes: 156b09482933 ("NFS: Request a directory delegation on ACCESS, CREATE, and UNLINK")
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
6f9bda23 5a74af51

+2 -19
+2 -19
fs/nfs/dir.c
··· 1516 1516 if (!nfs_dentry_verify_change(dir, dentry)) 1517 1517 return 0; 1518 1518 1519 - /* 1520 - * If we have a directory delegation then we don't need to revalidate 1521 - * the directory. The delegation will either get recalled or we will 1522 - * receive a notification when it changes. 1523 - */ 1524 - if (nfs_have_directory_delegation(dir)) 1525 - return 0; 1526 - 1527 1519 /* Revalidate nfsi->cache_change_attribute before we declare a match */ 1528 1520 if (nfs_mapping_need_revalidate_inode(dir)) { 1529 1521 if (rcu_walk) ··· 2209 2217 EXPORT_SYMBOL_GPL(nfs_atomic_open); 2210 2218 2211 2219 static int 2212 - nfs_lookup_revalidate_delegated_parent(struct inode *dir, struct dentry *dentry, 2213 - struct inode *inode) 2214 - { 2215 - return nfs_lookup_revalidate_done(dir, dentry, inode, 1); 2216 - } 2217 - 2218 - static int 2219 2220 nfs4_lookup_revalidate(struct inode *dir, const struct qstr *name, 2220 2221 struct dentry *dentry, unsigned int flags) 2221 2222 { ··· 2232 2247 if (inode == NULL) 2233 2248 goto full_reval; 2234 2249 2235 - if (nfs_verifier_is_delegated(dentry)) 2250 + if (nfs_verifier_is_delegated(dentry) || 2251 + nfs_have_directory_delegation(inode)) 2236 2252 return nfs_lookup_revalidate_delegated(dir, dentry, inode); 2237 - 2238 - if (nfs_have_directory_delegation(dir)) 2239 - return nfs_lookup_revalidate_delegated_parent(dir, dentry, inode); 2240 2253 2241 2254 /* NFS only supports OPEN on regular files */ 2242 2255 if (!S_ISREG(inode->i_mode))