mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Correct refcount_add in dmu_zfetch
refcount_add_many(foo,N) is not the same as
for (i=0; i < N; i++) { refcount_add(foo); }
Unfortunately, this is only actually true with debug kernels and
reference_tracking_enable=1.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12589
Closes #12602
This commit is contained in:
@@ -488,7 +488,8 @@ dmu_zfetch_run(zstream_t *zs, boolean_t missed, boolean_t have_lock)
|
||||
issued = pf_end - pf_start + ipf_end - ipf_start;
|
||||
if (issued > 1) {
|
||||
/* More references on top of taken in dmu_zfetch_prepare(). */
|
||||
zfs_refcount_add_many(&zs->zs_refs, issued - 1, NULL);
|
||||
for (int i = 0; i < issued - 1; i++)
|
||||
zfs_refcount_add(&zs->zs_refs, NULL);
|
||||
} else if (issued == 0) {
|
||||
/* Some other thread has done our work, so drop the ref. */
|
||||
if (zfs_refcount_remove(&zs->zs_refs, NULL) == 0)
|
||||
|
||||
Reference in New Issue
Block a user