Cluster-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] Fix freeze of cluster-2.03.11
@ 2009-04-20 12:27 Kadlecsik Jozsef
  2009-04-20 13:14 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 7+ messages in thread
From: Kadlecsik Jozsef @ 2009-04-20 12:27 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

I reported on the linux-cluster mailing list (see thread
https://www.redhat.com/archives/linux-cluster/2009-March/msg00176.html)
that version cluster-2.03.11 freezes.

As Wendy Cheng pointed out, the reason for this is that the filesystem API 
of the kernel changed and "put_inode" was replaced by "drop_inode": while 
"put_inode" was called without holding any lock, "drop_inode" is called 
under inode_lock held but the called gfs_sync_page_i may block
(https://www.redhat.com/archives/linux-cluster/2009-April/msg00060.html).

The patch below (applied in gfs-kernel/src/gfs/) fixes the bug by 
releasing the lock before calling gfs_sync_page_i and locking it back 
after the function call:

--- gfs-orig/ops_super.c	2009-01-22 13:33:51.000000000 +0100
+++ gfs/ops_super.c	2009-04-06 13:07:06.000000000 +0200
@@ -9,6 +9,7 @@
 #include <linux/statfs.h>
 #include <linux/seq_file.h>
 #include <linux/mount.h>
+#include <linux/writeback.h>
 
 #include "gfs.h"
 #include "dio.h"
@@ -68,8 +69,11 @@
 	if (ip &&
 	    !inode->i_nlink &&
 	    S_ISREG(inode->i_mode) &&
-	    !sdp->sd_args.ar_localcaching)
+	    !sdp->sd_args.ar_localcaching) {
+	    	spin_unlock(&inode_lock);
 		gfs_sync_page_i(inode, DIO_START | DIO_WAIT);
+		spin_lock(&inode_lock);
+	}
 	generic_drop_inode(inode);
 }
 

Additionally, the line

EXPORT_SYMBOL(inode_lock);

must be added to fs/inode.c in order to the inode_lock symbol get 
exported.

Best regards,
Jozsef
--
E-mail : kadlec at mail.kfki.hu, kadlec at blackhole.kfki.hu
PGP key: http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address: KFKI Research Institute for Particle and Nuclear Physics
         H-1525 Budapest 114, POB. 49, Hungary



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

end of thread, other threads:[~2009-04-22 11:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 12:27 [Cluster-devel] [PATCH] Fix freeze of cluster-2.03.11 Kadlecsik Jozsef
2009-04-20 13:14 ` Fabio M. Di Nitto
2009-04-20 13:33   ` Steven Whitehouse
2009-04-20 16:36     ` Kadlecsik Jozsef
2009-04-21  8:39       ` Steven Whitehouse
2009-04-22 11:55         ` Kadlecsik Jozsef
2009-04-22 11:59           ` Steven Whitehouse

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