Add comment on acb_zio_dummy

Thanks to George Wilson for clarifying this on Slack.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Christian Schwarz <christian.schwarz@nutanix.com>
Closes #13698
This commit is contained in:
Christian Schwarz 2022-08-09 01:55:13 +02:00 committed by GitHub
parent ad0967638b
commit 91983265b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6032,6 +6032,23 @@ top:
ARC_FLAG_PREDICTIVE_PREFETCH);
}
/*
* If there are multiple threads reading the same block
* and that block is not yet in the ARC, then only one
* thread will do the physical I/O and all other
* threads will wait until that I/O completes.
* Synchronous reads use the b_cv whereas nowait reads
* register a callback. Both are signalled/called in
* arc_read_done.
*
* Errors of the physical I/O may need to be propagated
* to the pio. For synchronous reads, we simply restart
* this function and it will reassess. Nowait reads
* attach the acb_zio_dummy zio to pio and
* arc_read_done propagates the physical I/O's io_error
* to acb_zio_dummy, and thereby to pio.
*/
if (*arc_flags & ARC_FLAG_WAIT) {
cv_wait(&hdr->b_l1hdr.b_cv, hash_lock);
mutex_exit(hash_lock);