[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200623195351.913172364@linuxfoundation.org>
Date: Tue, 23 Jun 2020 21:57:46 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Dave Botsch <botsch@....cornell.edu>,
Jeffrey Altman <jaltman@...istor.com>,
David Howells <dhowells@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.4 271/314] afs: Always include dir in bulk status fetch from afs_do_lookup()
From: David Howells <dhowells@...hat.com>
[ Upstream commit 13fcc6356a94558a0a4857dc00cd26b3834a1b3e ]
When a lookup is done in an AFS directory, the filesystem will speculate
and fetch up to 49 other statuses for files in the same directory and fetch
those as well, turning them into inodes or updating inodes that already
exist.
However, occasionally, a callback break might go missing due to NAT timing
out, but the afs filesystem doesn't then realise that the directory is not
up to date.
Alleviate this by using one of the status slots to check the directory in
which the lookup is being done.
Reported-by: Dave Botsch <botsch@....cornell.edu>
Suggested-by: Jeffrey Altman <jaltman@...istor.com>
Signed-off-by: David Howells <dhowells@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/afs/dir.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index d1e1caa23c8b3..3c486340b2208 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -658,7 +658,8 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
cookie->ctx.actor = afs_lookup_filldir;
cookie->name = dentry->d_name;
- cookie->nr_fids = 1; /* slot 0 is saved for the fid we actually want */
+ cookie->nr_fids = 2; /* slot 0 is saved for the fid we actually want
+ * and slot 1 for the directory */
read_seqlock_excl(&dvnode->cb_lock);
dcbi = rcu_dereference_protected(dvnode->cb_interest,
@@ -709,7 +710,11 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
if (!cookie->inodes)
goto out_s;
- for (i = 1; i < cookie->nr_fids; i++) {
+ cookie->fids[1] = dvnode->fid;
+ cookie->statuses[1].cb_break = afs_calc_vnode_cb_break(dvnode);
+ cookie->inodes[1] = igrab(&dvnode->vfs_inode);
+
+ for (i = 2; i < cookie->nr_fids; i++) {
scb = &cookie->statuses[i];
/* Find any inodes that already exist and get their
--
2.25.1
Powered by blists - more mailing lists