From 9aaad284880b32e0cd8a7b584f5d466854692457 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 2 Mar 2023 11:16:35 +0300 Subject: [PATCH] Fix "null pointer exception" for unhandled OSD_OP_DELETEs (when pool is not loaded yet) --- src/osd_primary_subops.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osd_primary_subops.cpp b/src/osd_primary_subops.cpp index 0d23eac4..829f0b83 100644 --- a/src/osd_primary_subops.cpp +++ b/src/osd_primary_subops.cpp @@ -53,7 +53,10 @@ void osd_t::finish_op(osd_op_t *cur_op, int retval) inode_stats[cur_op->req.rw.inode].op_count[inode_st_op]++; inode_stats[cur_op->req.rw.inode].op_sum[inode_st_op] += usec; if (cur_op->req.hdr.opcode == OSD_OP_DELETE) - inode_stats[cur_op->req.rw.inode].op_bytes[inode_st_op] += cur_op->op_data->pg_data_size * bs_block_size; + { + if (cur_op->op_data) + inode_stats[cur_op->req.rw.inode].op_bytes[inode_st_op] += cur_op->op_data->pg_data_size * bs_block_size; + } else inode_stats[cur_op->req.rw.inode].op_bytes[inode_st_op] += cur_op->req.rw.len; }