]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.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)
committerJeff Layton <jlayton@kernel.org>
Fri, 21 Jan 2022 14:27:59 +0000 (09:27 -0500)
commita97deedcb84a10360247475a20f1a6e39a8718b7
tree01e5e786c178593cccc1bde617cf1e546f28abc1
parent26ba236e6b34ac215639e4659ff5700f73ba3edd
ceph: put the requests/sessions when it fails to alloc memory

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
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Fixes: e1a4541ec0b9 ("ceph: flush the mdlog before waiting on unsafe reqs")
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/caps.c