If the state of the hdr != anon then it better be in the hash table. We should add an ASSERT() to make this clear to the developer.
Thanks, George On Thu, Sep 8, 2016 at 10:01 AM, Andriy Gapon <[email protected]> wrote: > > Coverity warns about the following possible problem in arc_read_done(): > if (zio->io_error == 0) { > arc_hdr_verify(hdr, zio->io_bp); > } else { > arc_hdr_set_flags(hdr, ARC_FLAG_IO_ERROR); > if (hdr->b_l1hdr.b_state != arc_anon) > arc_change_state(arc_anon, hdr, hash_lock); > if (HDR_IN_HASH_TABLE(hdr)) > buf_hash_remove(hdr); > freeable = refcount_is_zero(&hdr->b_l1hdr.b_refcnt); > } > > If !HDR_IN_HASH_TABLE(hdr) then hash_lock would be NULL. > And if io_error != 0 and hdr->b_l1hdr.b_state != arc_anon then > arc_change_state() would be called. And it requires that hash_lock is not > NULL. > > Is this a real possibility? > Or is there something that prevents those conditions from being true at > the same > time? > > Thank you. > -- > 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
