]> git.itanic.dy.fi Git - linux-stable/commit
ceph: handle the case where a dentry has been renamed on outstanding req
authorJeff Layton <jlayton@kernel.org>
Mon, 15 Apr 2019 16:00:42 +0000 (12:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:40:25 +0000 (19:40 +0200)
commit2455f6cbd19b99642f8022696fbe2094e32a813e
treea2be07b79c422dedc5105ccc5771e4330be96d33
parentd3a9275364d9c4257a76fdc2290cc19586b5acf6
ceph: handle the case where a dentry has been renamed on outstanding req

[ Upstream commit 4b8222870032715f9d995f3eb7c7acd8379a275d ]

It's possible for us to issue a lookup to revalidate a dentry
concurrently with a rename. If done in the right order, then we could
end up processing dentry info in the reply that no longer reflects the
state of the dentry.

If req->r_dentry->d_name differs from the one in the trace, then just
ignore the trace in the reply. We only need to do this however if the
parent's i_rwsem is not held.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/inode.c