ceph: put the requests/sessions when it fails to alloc memory
stable inclusion from stable-v5.10.157 commit 8e137ace53339eae14ced15143f95194a14999fd category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8e137ace53339eae14ced15143f95194a14999fd -------------------------------- [ Upstream commit 89d43d05 ] When failing to allocate the sessions memory we should make sure the req1 and req2 and the sessions get put. And also in case the max_sessions decreased so when kreallocate the new memory some sessions maybe missed being put. And if the max_sessions is 0 krealloc will return ZERO_SIZE_PTR, which will lead to a distinct access fault. URL: https://tracker.ceph.com/issues/53819 Fixes: e1a4541e ("ceph: flush the mdlog before waiting on unsafe reqs") Signed-off-by: NXiubo Li <xiubli@redhat.com> Reviewed-by: NVenky Shankar <vshankar@redhat.com> Reviewed-by: NJeff Layton <jlayton@kernel.org> Signed-off-by: NIlya Dryomov <idryomov@gmail.com> Stable-dep-of: 5bd76b8d ("ceph: fix NULL pointer dereference for req->r_session") Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
Showing
想要评论请 注册 或 登录