Skip to content

Commit

Permalink
DAOS-15745 dfuse: Add the pre_read metrics whilst holding reference. (d…
Browse files Browse the repository at this point in the history
…aos-stack#14256)

Increase the pre-read statistics before replying to the read,
otherwise the oh might not be valid which can lead to unexpected
behaviour.

Signed-off-by: Ashley Pittman <[email protected]>
  • Loading branch information
ashleypittman authored Apr 29, 2024
1 parent e01970d commit ee81e40
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/client/dfuse/ops/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ dfuse_readahead_reply(fuse_req_t req, size_t len, off_t position, struct dfuse_o
position + reply_len - 1, position + reply_len, position + len - 1);
}

DFUSE_IE_STAT_ADD(oh->doh_ie, DS_PRE_READ);
DFUSE_REPLY_BUFQ(oh, req, oh->doh_readahead->dra_ev->de_iov.iov_buf + position, reply_len);
return true;
}
Expand Down Expand Up @@ -143,10 +144,8 @@ dfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t len, off_t position, struct
replied = dfuse_readahead_reply(req, len, position, oh);
D_MUTEX_UNLOCK(&oh->doh_readahead->dra_lock);

if (replied) {
DFUSE_IE_STAT_ADD(oh->doh_ie, DS_PRE_READ);
if (replied)
return;
}
}

eqt_idx = atomic_fetch_add_relaxed(&dfuse_info->di_eqt_idx, 1);
Expand Down

0 comments on commit ee81e40

Please sign in to comment.