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

login
register
mail settings
Submitter Chris J Arges
Date Jan. 3, 2013, 8:18 p.m.
Message ID <50E5E786.1000302@canonical.com>
Download mbox
Permalink /patch/209306/
State New
Headers show

Pull-request

git://kernel.ubuntu.com/arges/ubuntu-quantal.git lp922906

Comments

Chris J Arges - Jan. 3, 2013, 8:18 p.m.
BugLink: http://bugs.launchpad.net/bugs/922906

SRU Justification:

Impact:
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: https://lkml.org/lkml/2011/1/19/213.

Fix:
A set of patches from upstream address this issue, this should already
be present in raring.

Testcase:
Comment #8 and #9 in the upstream bug:
https://bugzilla.kernel.org/show_bug.cgi?id=22602 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.

Note:
The SAUCE patches will need to be reverted, and it seems I missed a
patch when I did the fix before.

--

The following changes since commit de8dfe4a5e90bfa14e65dd7d1da30558223e950b:

  UBUNTU: Ubuntu-3.5.0-22.33 (2013-01-02 12:37:49 -0800)

are available in the git repository at:

  git://kernel.ubuntu.com/arges/ubuntu-quantal.git lp922906

for you to fetch changes up to bb388f66ad44b78359f706d0e5d87a3f5e11e68a:

  fsnotify: change locking order (2013-01-03 11:31:18 -0600)

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

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

 fs/notify/mark.c                 |   20 ++++++++++----------
 include/linux/fsnotify_backend.h |    7 ++++---
 kernel/audit_tree.c              |    4 ++--
 3 files changed, 16 insertions(+), 15 deletions(-)