diff mbox

[15/33] fsnotify: Remove useless list deletion and comment

Message ID 20170315104632.7037-16-jack@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kara March 15, 2017, 10:46 a.m. UTC
After removing all the indirection it is clear that

hlist_del_init_rcu(&mark->obj_list);

in fsnotify_destroy_marks() is not needed as the mark gets removed from
the list shortly afterwards in fsnotify_destroy_mark() ->
fsnotify_detach_mark() -> fsnotify_detach_from_object(). Also there is
no problem with mark being visible on object list while we call
fsnotify_destroy_mark() as parallel destruction of marks from several
places is properly handled (as mentioned in the comment in
fsnotify_destroy_marks(). So just remove the list removal and also the
stale comment.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/notify/mark.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Amir Goldstein March 15, 2017, 8:23 p.m. UTC | #1
On Wed, Mar 15, 2017 at 12:46 PM, Jan Kara <jack@suse.cz> wrote:
> After removing all the indirection it is clear that
>
> hlist_del_init_rcu(&mark->obj_list);
>
> in fsnotify_destroy_marks() is not needed as the mark gets removed from
> the list shortly afterwards in fsnotify_destroy_mark() ->
> fsnotify_detach_mark() -> fsnotify_detach_from_object(). Also there is
> no problem with mark being visible on object list while we call
> fsnotify_destroy_mark() as parallel destruction of marks from several
> places is properly handled (as mentioned in the comment in
> fsnotify_destroy_marks(). So just remove the list removal and also the
> stale comment.
>
> Signed-off-by: Jan Kara <jack@suse.cz>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
diff mbox

Patch

diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index cbc7149e17a3..a9dc7afe803d 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -614,12 +614,6 @@  void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn)
 		}
 		mark = hlist_entry(conn->list.first, struct fsnotify_mark,
 				   obj_list);
-		/*
-		 * We don't update i_fsnotify_mask / mnt_fsnotify_mask here
-		 * since inode / mount is going away anyway. So just remove
-		 * mark from the list.
-		 */
-		hlist_del_init_rcu(&mark->obj_list);
 		fsnotify_get_mark(mark);
 		spin_unlock(lock);
 		fsnotify_destroy_mark(mark, mark->group);