ceph: fix deadlock or deadcode of misusing dget()
authorXiubo Li <xiubli@redhat.com>
Fri, 17 Nov 2023 05:26:18 +0000 (13:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:33 +0000 (20:14 +0000)
commit196b87e5c00ce021e164a5de0f0d04f4116a9160
treec30b5a73631a5a07544a35e27b2317d8cc345345
parent987219b377cc8e2e1e36842694c2942cd5afaf03
ceph: fix deadlock or deadcode of misusing dget()

[ Upstream commit b493ad718b1f0357394d2cdecbf00a44a36fa085 ]

The lock order is incorrect between denty and its parent, we should
always make sure that the parent get the lock first.

But since this deadcode is never used and the parent dir will always
be set from the callers, let's just remove it.

Link: https://lore.kernel.org/r/20231116081919.GZ1957730@ZenIV
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c