Skip to content

Commit a68cc3b

Browse files
dbshah12claude
andcommitted
DLPX-88427 Fix self-contradictory comment in metaslab_alloc_dva_exit
The previous comment incorrectly implied that a live map entry means failure and contained an unfinished correction ("resets ts=0... no, it doesn't"). Reword to accurately describe the control flow: the entry is present on both success and failure paths; only PT_REGS_RC determines whether the failure metric is emitted. Addresses review comment on PR #121. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 5d5a87d commit a68cc3b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

bpf/estat/metaslab-alloc.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,11 @@ metaslab_alloc_dva_exit(struct pt_regs *ctx,
224224
return (0);
225225

226226
/*
227-
* A live entry here means the overall DVA allocation failed (on
228-
* success, metaslab_group_alloc_exit resets ts=0... no, it doesn't —
229-
* it only resets vd_name and asize). Emit an "allocation failures"
230-
* metric only when the return value indicates failure (non-zero).
231-
* psize is stored in data->size from metaslab_alloc_dva_entry since
232-
* kretprobe argument registers may be clobbered by function return.
227+
* A live entry exists on both success and failure paths; only the
228+
* return code determines whether to emit an "allocation failures"
229+
* metric (non-zero RC = failure). psize is read from data->size
230+
* rather than the kretprobe argument registers, which may be
231+
* clobbered by the time the function returns.
233232
*/
234233
if (PT_REGS_RC(ctx) != 0) {
235234
char name[] = "allocation failures";

0 commit comments

Comments
 (0)