]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ceph: put the requests/sessions when it fails to alloc memory
authorXiubo Li <xiubli@redhat.com>
Wed, 12 Jan 2022 04:29:04 +0000 (12:29 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:54 +0000 (10:28 +0100)
commitafd9df4fc230afbb1b6d5bb1c75402d2b979df68
treec033a8e1799104c9429d144ee790d15450f3a967
parent1cedba23c0b858eb74836990d6386dc162c81409
ceph: put the requests/sessions when it fails to alloc memory

BugLink: https://bugs.launchpad.net/bugs/1959879
[ Upstream commit 89d43d0551a848e70e63d9ba11534aaeabc82443 ]

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: e1a4541ec0b9 ("ceph: flush the mdlog before waiting on unsafe reqs")
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Venky Shankar <vshankar@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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/ceph/caps.c