Patchwork [precise,sru] pull-request: fsnotify: simplify locking

mail settings
Submitter Chris J Arges
Date Dec. 10, 2012, 6:07 p.m.
Message ID <>
Download mbox
Permalink /patch/205004/
State New
Headers show


git:// lp922906


Chris J Arges - Dec. 10, 2012, 6:07 p.m.

SRU Justification:

When plugging and unplugging a USB drive occasionally a race condition
in the notify subsystem causes a kernel oops. A more in depth explaining
can be found here:

A set up of patches
found in the for-next branch in the notify.git tree solve this issue:
These have been cherry-picked and tested on precise/quantal and applied
already to raring. Only small modifications are needed for 2 of the
patches because the locations of the functions had changed other than
that the other 7 patches are clean cherry-picks.

Comment #8 and #9 in the upstream bug: has a test case that
easily reproduces this issue within 15-30 minutes. I have applied the
above fixes and was able to run this test case overnight in all cases.
In addition I've tested using the LTP tests for inotfy and these run
properly with the fix applied.


The following changes since commit ba6c2f688e255a1f52f2930ae9e6d62ede804289:

  UBUNTU: Ubuntu-3.2.0-34.53 (2012-11-14 15:50:53 +0000)

are available in the git repository at:

  git:// lp922906

for you to fetch changes up to 937c3c88ab712f93548a321566e5d85a11664291:

  UBUNTU: SAUCE: fsnotify: dont put marks on temporary list when
clearing marks by group (2012-12-07 15:19:03 -0600)

Lino Sanfilippo (8):
      UBUNTU: SAUCE: fsnotify: introduce fsnotify_get_group()
      UBUNTU: SAUCE: fsnotify: use reference counting for groups
      UBUNTU: SAUCE: fsnotify: take groups mark_lock before mark lock
      UBUNTU: SAUCE: fanotify: add an extra flag to
mark_remove_from_mask that indicates wheather a mark should be destroyed
      UBUNTU: SAUCE: fsnotify: use a mutex instead of a spinlock to
protect a groups mark list
      UBUNTU: SAUCE: fsnotify: pass group to fsnotify_destroy_mark()
      UBUNTU: SAUCE: fsnotify: introduce locked versions of
fsnotify_add_mark() and fsnotify_remove_mark()
      UBUNTU: SAUCE: fsnotify: dont put marks on temporary list when
clearing marks by group

 fs/notify/dnotify/dnotify.c          |    4 +-
 fs/notify/fanotify/fanotify_user.c   |   19 +++++---
 fs/notify/group.c                    |   38 ++++++++--------
 fs/notify/inode_mark.c               |   14 ++++--
 fs/notify/inotify/inotify_fsnotify.c |    4 +-
 fs/notify/inotify/inotify_user.c     |    3 +-
 fs/notify/mark.c                     |   81
 fs/notify/vfsmount_mark.c            |   14 ++++--
 include/linux/fsnotify_backend.h     |   16 ++++---
 kernel/audit_tree.c                  |   10 ++---
 kernel/audit_watch.c                 |    4 +-
 11 files changed, 125 insertions(+), 82 deletions(-)
Tim Gardner - Dec. 10, 2012, 9:54 p.m.
I've gone ahead and applied these patches to Precise. We've had a pretty 
good experience with these patches in Raring, so lets hope the same 
holds true for Precise and Quantal.

You should build master-next and retest since there are a bunch of 
stable patches introduced beyond your pull request SHA1.