]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
fsnotify: Detach mark from object list when last reference is dropped
authorJan Kara <jack@suse.cz>
Wed, 21 Dec 2016 11:15:30 +0000 (12:15 +0100)
committerJan Kara <jack@suse.cz>
Mon, 10 Apr 2017 15:37:36 +0000 (17:37 +0200)
commit6b3f05d24d355f50f3d9814304650fcab0efb482
tree362bb47ec0f38adc2cdd05f28e3a25ece2f66787
parent11375145a70d69e871dd5b8fcadd5d1ee4162e7c
fsnotify: Detach mark from object list when last reference is dropped

Instead of removing mark from object list from fsnotify_detach_mark(),
remove the mark when last reference to the mark is dropped. This will
allow fanotify to wait for userspace response to event without having to
hold onto fsnotify_mark_srcu.

To avoid pinning inodes by elevated refcount (and thus e.g. delaying
file deletion) while someone holds mark reference, we detach connector
from the object also from fsnotify_destroy_marks() and not only after
removing last mark from the list as it was now.

Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/mark.c
include/linux/fsnotify_backend.h
kernel/audit_tree.c