]> git.baikalelectronics.ru Git - kernel.git/commit
fsnotify: Protect bail out path of fsnotify_add_mark_locked() properly
authorJan Kara <jack@suse.cz>
Tue, 31 Oct 2017 09:09:25 +0000 (10:09 +0100)
committerJan Kara <jack@suse.cz>
Tue, 31 Oct 2017 16:54:56 +0000 (17:54 +0100)
commit9ab8e7c5a775426bf4167b1cefbd7825ae2cdb4f
tree7eac90d6bf1a97b485d6a3b7483042089d3756d7
parentce02def3fbf35aa961a35575a86afcf295c5cec3
fsnotify: Protect bail out path of fsnotify_add_mark_locked() properly

When fsnotify_add_mark_locked() fails it cleans up the mark it was
adding. Since the mark is already visible in group's list, we should
protect update of mark->flags with mark->lock. I'm not aware of any real
issues this could cause (since we also hold group->mark_mutex) but
better be safe and obey locking rules properly.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/mark.c