I can not figure out how the following code actually works.
Probably I am missing something in the big picture (again).

if (HDR_L2_WRITE_HEAD(ab)) {
        /*
         * We hit a write head node.  Leave it for
         * l2arc_write_done().
         */
        list_remove(buflist, ab);
        mutex_exit(hash_lock);
        continue;
}

So, the write head is left in memory, but it is still removed from l2ad_buflist.
Supposing there is a corresponding L2 write zio in progress there will be a call
to l2arc_write_done() with l2wcb_head pointing to the head.
Wouldn't
        list_prev(buflist, head)
result in an illegal memory access if head is not on buflist?

Thanks!
-- 
Andriy Gapon
_______________________________________________
developer mailing list
developer@open-zfs.org
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to