public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.6-mm2] vfs iput in inode critical region
@ 2004-05-13 19:26 FabF
  2004-05-14 22:47 ` viro
  0 siblings, 1 reply; 5+ messages in thread
From: FabF @ 2004-05-13 19:26 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

Hi,

	AFAICS, block_dev.c : do_open calls bdput after an unlock_kernel.bdput
calls iput and iput plays with some parameters and locks in iput final
case only.Here's a patch to have a spinlock around the whole iput.

Regards,
FabF 

[-- Attachment #2: inodeputspin1.diff --]
[-- Type: text/x-patch, Size: 653 bytes --]

diff -Naur orig/fs/inode.c edited/fs/inode.c
--- orig/fs/inode.c	2004-05-11 10:13:15.000000000 +0200
+++ edited/fs/inode.c	2004-05-13 21:10:48.000000000 +0200
@@ -1081,16 +1081,20 @@
 void iput(struct inode *inode)
 {
 	if (inode) {
+		spin_lock(&inode_lock);
 		struct super_operations *op = inode->i_sb->s_op;
 
 		if (inode->i_state == I_CLEAR)
 			BUG();
 
+		/*Calling fs relevant put_inode*/
 		if (op && op->put_inode)
 			op->put_inode(inode);
 
-		if (atomic_dec_and_lock(&inode->i_count, &inode_lock))
+		/*finalize if inode is unused*/
+		if (atomic_dec_and_test(&inode->i_count))
 			iput_final(inode);
+		spin_unlock(&inode_lock);
 	}
 }
 

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

end of thread, other threads:[~2004-05-15  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-13 19:26 [PATCH 2.6.6-mm2] vfs iput in inode critical region FabF
2004-05-14 22:47 ` viro
2004-05-13 15:02   ` FabF
2004-05-15  6:33     ` viro
2004-05-14  6:35       ` FabF

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