]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ceph: fix inode reference leakage in ceph_get_snapdir()
authorXiubo Li <xiubli@redhat.com>
Wed, 2 Mar 2022 06:51:53 +0000 (14:51 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:21 +0000 (11:59 +0200)
commit40d4a5553792eade2c6a69d45cb9ec2f55be6336
tree2cd4eaa546e77d45ee3660cdd27bba86395c7305
parent43ea8b0a6bf07e91fc754dd2ac0eab8404336fe6
ceph: fix inode reference leakage in ceph_get_snapdir()

BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit 322794d3355c33adcc4feace0045d85a8e4ed813 ]

The ceph_get_inode() will search for or insert a new inode into the
hash for the given vino, and return a reference to it. If new is
non-NULL, its reference is consumed.

We should release the reference when in error handing cases.

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>
(cherry picked from commit 3ae7163598c611a8892698e0c056fe794e52b44b)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/ceph/inode.c