• Jan Kara's avatar
    fsnotify: Move queueing of mark for destruction into fsnotify_put_mark() · 11375145
    Jan Kara authored
    Currently we queue mark into a list of marks for destruction in
    __fsnotify_free_mark() and keep the last mark reference dangling. After the
    worker waits for SRCU period, it drops the last reference to the mark
    which frees it. This scheme has the disadvantage that if we hold
    reference to a mark and drop and reacquire SRCU lock, the mark can get
    freed immediately which is slightly inconvenient and we will need to
    avoid this in the future.
    
    Move to a scheme where queueing of mark into a list of marks for
    destruction happens when the last reference to the mark is dropped. Also
    drop reference to the mark held by group list already when mark is
    removed from that list instead of dropping it only from the destruction
    worker.
    Reviewed-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    Reviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    11375145
inotify_user.c 20.2 KB