On 6/8/23 23:09, Shinichiro Kawasaki wrote:
[...] Thanks for the notice. I think the defect report is false-positive. The variable in_flight is on the stack and thread local, so no other thread can change it across the zone_unlock() and zone_lock(). I guess and hope the following patch will suppress the report. May I ask Vincent or Jens to confirm it? If its formal patch helps, please let me know. diff --git a/zbd.c b/zbd.c index 9455140a..7fcf1ec4 100644 --- a/zbd.c +++ b/zbd.c @@ -1547,11 +1547,11 @@ retry: dprint(FD_ZBD, "%s(%s): wait zone write and retry write target zone selection\n", __func__, f->file_name); + should_retry = in_flight; pthread_mutex_unlock(&zbdi->mutex); zone_unlock(z); io_u_quiesce(td); zone_lock(td, f, z); - should_retry = in_flight; goto retry; }
Shin'ichiro, yes the above patch silences the Coverity complaint. Would you send a patch for me to apply?
Vincent