public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] reiserfs fixes
@ 2010-01-02  1:27 Frederic Weisbecker
  2010-01-02 13:41 ` Andi Kleen
  2010-01-02 19:19 ` Linus Torvalds
  0 siblings, 2 replies; 27+ messages in thread
From: Frederic Weisbecker @ 2010-01-02  1:27 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Frederic Weisbecker, Christian Kujau, Alexander Beregalov,
	Chris Mason, Ingo Molnar

Linus,

Please pull the reiserfs/kill-bkl branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	reiserfs/kill-bkl

These changes fix a lot of lock inversions, some of them were
triggering soft lockups very easily in xattrs operations.

As the reiserfs lock is a giant lock (in reiserfs scope),
these dependency inversions couldn't get smart fixes without a deep
locking rewrite.

That's why you'll mostly find dependency inversion fixes based on
such pattern:

reiserfs_write_unlock()
mutex_lock(random_lock)
reiserfs_write_lock()

This is not beautiful but at least that's better than the bkl.

Oh and I expect other lock inversions will get reported in
the future due to rare and then yet untested paths.

Thanks,
	Frederic
---

Frederic Weisbecker (13):
      reiserfs: Fix possible recursive lock
      reiserfs: Fix reiserfs lock and journal lock inversion dependency
      reiserfs: Fix reiserfs lock <-> inode mutex dependency inversion
      reiserfs: Fix remaining in-reclaim-fs <-> reclaim-fs-on locking inversion
      reiserfs: Fix reiserfs lock <-> i_xattr_sem dependency inversion
      reiserfs: Warn on lock relax if taken recursively
      reiserfs: Fix reiserfs lock <-> i_mutex dependency inversion on xattr
      reiserfs: Relax reiserfs lock while freeing the journal
      reiserfs: Relax lock before open xattr dir in reiserfs_xattr_set_handle()
      reiserfs: Fix unwanted recursive reiserfs lock in reiserfs_unlink()
      reiserfs: Fix journal mutex <-> inode mutex lock inversion
      reiserfs: Safely acquire i_mutex from reiserfs_for_each_xattr
      reiserfs: Safely acquire i_mutex from xattr_rmdir


 fs/reiserfs/bitmap.c        |    3 +++
 fs/reiserfs/inode.c         |    5 +++--
 fs/reiserfs/journal.c       |   18 ++++++++++++++----
 fs/reiserfs/lock.c          |    9 +++++++++
 fs/reiserfs/namei.c         |    7 ++++---
 fs/reiserfs/xattr.c         |   26 ++++++++++++++++++++------
 include/linux/reiserfs_fs.h |   26 ++++++++++++++++++++++++++
 7 files changed, 79 insertions(+), 15 deletions(-)

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [GIT PULL] reiserfs fixes
@ 2010-02-14 18:14 Frederic Weisbecker
  0 siblings, 0 replies; 27+ messages in thread
From: Frederic Weisbecker @ 2010-02-14 18:14 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Frederic Weisbecker, Alexander Beregalov, Christian Kujau,
	Chris Mason

Linus,

Please pull the reiserfs/kill-bkl branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	reiserfs/kill-bkl

Thanks,
	Frederic
---

Frederic Weisbecker (1):
      reiserfs: Fix softlockup while waiting on an inode


 fs/reiserfs/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

---
commit 175359f89df39f4faed663c8cfd6ee0222d2fa1e
Author: Frederic Weisbecker <fweisbec@gmail.com>
Date:   Thu Feb 11 13:13:10 2010 +0100

    reiserfs: Fix softlockup while waiting on an inode
    
    When we wait for an inode through reiserfs_iget(), we hold
    the reiserfs lock. And waiting for an inode may imply waiting
    for its writeback. But the inode writeback path may also require
    the reiserfs lock, which leads to a deadlock.
    
    We just need to release the reiserfs lock from reiserfs_iget()
    to fix this.
    
    Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
    Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
    Tested-by: Christian Kujau <lists@nerdbynature.de>
    Cc: Chris Mason <chris.mason@oracle.com>

diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 9087b10..2df0f5c 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1497,9 +1497,11 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key)
 
 	args.objectid = key->on_disk_key.k_objectid;
 	args.dirid = key->on_disk_key.k_dir_id;
+	reiserfs_write_unlock(s);
 	inode = iget5_locked(s, key->on_disk_key.k_objectid,
 			     reiserfs_find_actor, reiserfs_init_locked_inode,
 			     (void *)(&args));
+	reiserfs_write_lock(s);
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2010-02-14 18:14 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-02  1:27 [GIT PULL] reiserfs fixes Frederic Weisbecker
2010-01-02 13:41 ` Andi Kleen
2010-01-02 16:36   ` Frederic Weisbecker
2010-01-02 17:43     ` reiserfs broken in 2.6.32 was " Andi Kleen
2010-01-02 19:02       ` Frederic Weisbecker
2010-01-02 19:23         ` Andi Kleen
2010-01-02 20:11           ` Frederic Weisbecker
2010-01-02 20:33             ` Andi Kleen
2010-01-02 20:54               ` Frederic Weisbecker
2010-01-02 21:10               ` Ingo Molnar
2010-01-02 21:42               ` Ingo Molnar
2010-01-02 21:01             ` tytso
2010-01-02 21:06               ` Frederic Weisbecker
2010-01-02 23:36                 ` tytso
2010-01-02 23:43                   ` Christian Kujau
2010-01-03  1:16                     ` Frederic Weisbecker
2010-01-03  1:52                   ` Frederic Weisbecker
2010-01-03  2:05                     ` Christian Kujau
2010-01-03  3:27                       ` tytso
2010-01-04 20:20                         ` Frederic Weisbecker
2010-01-02 20:11       ` Ingo Molnar
2010-01-02 22:18       ` Ingo Molnar
2010-01-02 19:19 ` Linus Torvalds
2010-01-02 19:21   ` Linus Torvalds
2010-01-02 19:24     ` Frederic Weisbecker
2010-01-02 19:22   ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2010-02-14 18:14 Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox