diff options
| author | Miklos Szeredi <[email protected]> | 2012-09-17 20:23:30 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-09-30 00:41:40 +0000 |
| commit | 8110e16d42d587997bcaee0c864179e6d93603fe (patch) | |
| tree | 210b83419cc6464b1a1faff58c47d8316f6e5939 /fs/hppfs/hppfs.c | |
| parent | Merge tag 'iommu-fixes-v3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
| download | kernel-8110e16d42d587997bcaee0c864179e6d93603fe.tar.gz kernel-8110e16d42d587997bcaee0c864179e6d93603fe.zip | |
vfs: dcache: fix deadlock in tree traversal
IBM reported a deadlock in select_parent(). This was found to be caused
by taking rename_lock when already locked when restarting the tree
traversal.
There are two cases when the traversal needs to be restarted:
1) concurrent d_move(); this can only happen when not already locked,
since taking rename_lock protects against concurrent d_move().
2) racing with final d_put() on child just at the moment of ascending
to parent; rename_lock doesn't protect against this rare race, so it
can happen when already locked.
Because of case 2, we need to be able to handle restarting the traversal
when rename_lock is already held. This patch fixes all three callers of
try_to_ascend().
IBM reported that the deadlock is gone with this patch.
[ I rewrote the patch to be smaller and just do the "goto again" if the
lock was already held, but credit goes to Miklos for the real work.
- Linus ]
Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Al Viro <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/hppfs/hppfs.c')
0 files changed, 0 insertions, 0 deletions
