If we cancel a read, revoke the rx buffers to avoid a use-after-free and/or
other undefined badness by using user buffers that may no longer be
present.
Fixes: #9362
Backport: firefly, dumpling
Reported-by: Matthias Kiefer <matthias.kiefer@1und1.de>
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit
2305b2897acba38384358c33ca3bbfcae6f1c74e)
(adjusted for op->con instead of s->con)
ldout(cct, 10) << __func__ << " tid " << tid << dendl;
Op *op = p->second;
+ if (op->con) {
+ ldout(cct, 20) << " revoking rx buffer for " << tid
+ << " on " << op->con << dendl;
+ op->con->revoke_rx_buffer(tid);
+ }
if (op->onack) {
op->onack->complete(r);
op->onack = NULL;