]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "fsnotify: fix oops in fsnotify_clear_marks_by_group_flags()"
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Jul 2015 23:06:53 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Jul 2015 23:06:53 +0000 (16:06 -0700)
commiteba9f70166763cc1c86ecb5d889f86c4b6ffa45a
tree7d071492f1ab656913be0c892497d3204928ce0a
parent32c7fc6e15e3ea73558d27a370d93de2cfc81fe2
Revert "fsnotify: fix oops in fsnotify_clear_marks_by_group_flags()"

This reverts commit 36408ab8e256603f31f53ddf937d59cbb8318bfb.

Kinglong Mee reports a memory leak with that patch, and Jan Kara confirms:

 "Thanks for report! You are right that my patch introduces a race
  between fsnotify kthread and fsnotify_destroy_group() which can result
  in leaking inotify event on group destruction.

  I haven't yet decided whether the right fix is not to queue events for
  dying notification group (as that is pointless anyway) or whether we
  should just fix the original problem differently...  Whenever I look
  at fsnotify code mark handling I get lost in the maze of locks, lists,
  and subtle differences between how different notification systems
  handle notification marks :( I'll think about it over night"

and after thinking about it, Jan says:

 "OK, I have looked into the code some more and I found another
  relatively simple way of fixing the original oops.  It will be IMHO
  better than trying to fixup this issue which has more potential for
  breakage.  I'll ask Linus to revert the fsnotify fix he already merged
  and send a new fix"

Reported-by: Kinglong Mee <kinglongmee@gmail.com>
Requested-by: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/notify/mark.c