OSDN Git Service

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)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 23 Apr 2019 19:37:54 +0000 (21:37 +0200)
commit4b8222870032715f9d995f3eb7c7acd8379a275d
tree922907eb1251073439bc094e76800b7f1188c098
parent76a495d666e5043ffc315695f8241f5e94a98849
ceph: handle the case where a dentry has been renamed on outstanding req

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>
fs/ceph/inode.c