ceph: fix memory leak in ceph_readdir when note_last_dentry returns error
authorXiubo Li <xiubli@redhat.com>
Sat, 5 Mar 2022 11:52:59 +0000 (19:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:10 +0000 (20:59 +0200)
commit2fe82d3254029ef9ec4e7be890125d5ef4f537de
tree36c16a5428be10fcf030f46d7085c9aa75ace73a
parent3ae7163598c611a8892698e0c056fe794e52b44b
ceph: fix memory leak in ceph_readdir when note_last_dentry returns error

[ Upstream commit f639d9867eea647005dc824e0e24f39ffc50d4e4 ]

Reset the last_readdir at the same time, and add a comment explaining
why we don't free last_readdir when dir_emit returns false.

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/dir.c