• J. R. Okajima's avatar
    aufs: bugfix, ignore the being freed dynop object · e870e818
    J. R. Okajima authored
    
    
    Aufs DYNOP (Dynamically customizable FS operations) object is managed by
    kref, and when its counter reaches zero, the callback function removes
    the object from the internal list which is protected by a spinlock and
    then frees the object.
    Here there is a small time window between
    A: the counter reaches zero, and
    B: require the lock to remove the object from the list.
    If someone else acquires the lock and searches the list, it may find the
    counter-zero'ed object which means the object is being freed.
    This commit ignores the object whose counter is already zero.
    Reported-and-tested-by: default avatarKirill Kolyshkin <kolyshkin@gmail.com>
    Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
    (cherry picked from commit b633d7b2635b9615fe294b85257d05008e3747a3)
    e870e818
dynop.c 7.6 KB