ceph: fix memory leak in ceph_readdir when note_last_dentry returns error
BugLink: https://bugs.launchpad.net/bugs/1969107
[ 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>
(cherry picked from commit
2fe82d3254029ef9ec4e7be890125d5ef4f537de)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>