I had to think about it for a few minutes, but that access looks ok to me. If we hit that case, we know the destroyed buf isn't the shared one (otherwise we would have run "arc_hdr_clear_flags(hdr, ARC_FLAG_SHARED_DATA)" above and "HDR_SHARED_DATA(hdr)" wouldn't have been true), so there must be some other shared buf on the list, and that's guaranteed to be the one at the end of the list.
Thanks, Dan On Thu, Sep 8, 2016 at 7:38 AM, Andriy Gapon <[email protected]> wrote: > /* > If the current arc_buf_t is sharing its data > buffer with the hdr, then reassign the hdr's > b_pdata to share it with the new buffer at the end > of the list. The shared buffer is always the last one > on the hdr's buffer list. > */ > if (destroyed_buf_is_shared && lastbuf != NULL) { > ... > } else if (HDR_SHARED_DATA(hdr)) { > ASSERT(arc_buf_is_shared(lastbuf)); > } > > Coverity "thinks" that lastbuf could be NULL in the else-if branch. > That seems to be possible if the removed buf is the only buf on the hdr's > list. > But I am not sure if HDR_SHARED_DATA(hdr) can be true in that case here. > > -- > Andriy Gapon > ------------------------------------------- openzfs-developer Archives: https://www.listbox.com/member/archive/274414/=now RSS Feed: https://www.listbox.com/member/archive/rss/274414/28015062-cce53afa Modify Your Subscription: https://www.listbox.com/member/?member_id=28015062&id_secret=28015062-f966d51c Powered by Listbox: http://www.listbox.com
