Re: [PATCH] make lock_super recursive to simulate BKL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, August 19, 2008 - 3:21 pm

On Tue, 19 Aug 2008, Bart Trojanowski wrote:

I agree that it's going to almost certainly fix the regression, but could 
you test the following patch instead as an alternative? I'd rather remove 
the broken recursive lockign than introduce it as an acceptable concept.

		Linus
---
 fs/fat/inode.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 6d266d7..80ff338 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -562,26 +562,23 @@ static int fat_write_inode(struct inode *inode, int wait)
 	struct buffer_head *bh;
 	struct msdos_dir_entry *raw_entry;
 	loff_t i_pos;
-	int err = 0;
+	int err;
 
 retry:
 	i_pos = MSDOS_I(inode)->i_pos;
 	if (inode->i_ino == MSDOS_ROOT_INO || !i_pos)
 		return 0;
 
-	lock_super(sb);
 	bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits);
 	if (!bh) {
 		printk(KERN_ERR "FAT: unable to read inode block "
 		       "for updating (i_pos %lld)\n", i_pos);
-		err = -EIO;
-		goto out;
+		return -EIO;
 	}
 	spin_lock(&sbi->inode_hash_lock);
 	if (i_pos != MSDOS_I(inode)->i_pos) {
 		spin_unlock(&sbi->inode_hash_lock);
 		brelse(bh);
-		unlock_super(sb);
 		goto retry;
 	}
 
@@ -607,11 +604,10 @@ retry:
 	}
 	spin_unlock(&sbi->inode_hash_lock);
 	mark_buffer_dirty(bh);
+	err = 0;
 	if (wait)
 		err = sync_dirty_buffer(bh);
 	brelse(bh);
-out:
-	unlock_super(sb);
 	return err;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Bart Trojanowski, (Tue Aug 19, 3:03 pm)
[PATCH] make lock_super recursive to simulate BKL, Bart Trojanowski, (Tue Aug 19, 3:06 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Linus Torvalds, (Tue Aug 19, 3:17 pm)
Re: [PATCH] make lock_super recursive to simulate BKL, Linus Torvalds, (Tue Aug 19, 3:21 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Bart Trojanowski, (Tue Aug 19, 5:03 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Linus Torvalds, (Tue Aug 19, 5:11 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Bart Trojanowski, (Tue Aug 19, 5:18 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Bart Trojanowski, (Tue Aug 19, 5:24 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Linus Torvalds, (Tue Aug 19, 5:43 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Linus Torvalds, (Tue Aug 19, 5:56 pm)
Re: [PATCH] make lock_super recursive to simulate BKL, Bart Trojanowski, (Tue Aug 19, 6:14 pm)
Re: vfat BKL/lock_super regression in v2.6.26-rc3-g8f59342, Bart Trojanowski, (Tue Aug 19, 7:27 pm)
[PATCH] document additional vfat mount options, Bart Trojanowski, (Fri Aug 22, 5:54 pm)
Re: [PATCH] document additional vfat mount options, Grant Coady, (Fri Aug 22, 7:33 pm)
Re: [PATCH] document additional vfat mount options, OGAWA Hirofumi, (Fri Aug 22, 8:10 pm)
Re: [PATCH] document additional vfat mount options, Bart Trojanowski, (Fri Aug 22, 8:12 pm)
[PATCH] document additional vfat mount options, Bart Trojanowski, (Fri Aug 22, 8:14 pm)
Re: [PATCH] document additional vfat mount options, OGAWA Hirofumi, (Fri Aug 22, 8:27 pm)
Re: [PATCH] document additional vfat mount options, Bart Trojanowski, (Sat Aug 23, 6:11 am)
Re: [PATCH] document additional vfat mount options, OGAWA Hirofumi, (Sat Aug 23, 7:47 am)