[Cluster-devel] GFS2: Pull request (fixes)

2011-01-19 Thread Steven Whitehouse
Hi,

Please consider pulling the following GFS2 bug fixes,

Steve.

--

The following changes since commit e6f597a1425b5af64917be3448b29e2d5a585ac8:

  staging: fix build failure in bcm driver (2011-01-17 17:39:39 -0800)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git master

Benjamin Marzinski (1):
  GFS2: remove iopen glocks from cache on failed deletes

Steven Whitehouse (1):
  GFS2: Fix error path in gfs2_lookup_by_inum()

 fs/gfs2/inode.c |   72 --
 fs/gfs2/inode.h |1 -
 fs/gfs2/super.c |1 +
 3 files changed, 23 insertions(+), 51 deletions(-)

-
From 23c3010808de86f21436eb822aacfa551bfc17e4 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski bmarz...@redhat.com
Date: Fri, 14 Jan 2011 22:39:16 -0600
Subject: [PATCH 1/2] GFS2: remove iopen glocks from cache on failed deletes

When a file gets deleted on GFS2, if a node can't get an exclusive lock on the
file's iopen glock, it punts on actually freeing up the space, because another
node is using the file.  When it does this, it needs to drop the iopen glock
from its cache so that the other node can get an exclusive lock on it. Now,
gfs2_delete_inode() sets GL_NOCACHE before dropping the shared lock on the
iopen glock in preparation for grabbing it in the exclusive state.  Since the
node needs the glock in the exclusive state, dropping the shared lock from the
cache doesn't slow down the case where no other nodes are using the file.

Signed-off-by: Benjamin Marzinski bmarz...@redhat.com
Signed-off-by: Steven Whitehouse swhit...@redhat.com

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 16c2eca..ec73ed7 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1336,6 +1336,7 @@ static void gfs2_evict_inode(struct inode *inode)
if (error)
goto out_truncate;
 
+   ip-i_iopen_gh.gh_flags |= GL_NOCACHE;
gfs2_glock_dq_wait(ip-i_iopen_gh);
gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, 
ip-i_iopen_gh);
error = gfs2_glock_nq(ip-i_iopen_gh);
-- 
1.7.3.3

--
From 24d9765fc18c7838ccdbb0d71fb706321d9b824c Mon Sep 17 00:00:00 2001
From: Steven Whitehouse swhit...@redhat.com
Date: Tue, 18 Jan 2011 14:49:08 +
Subject: [PATCH 2/2] GFS2: Fix error path in gfs2_lookup_by_inum()

In the (impossible, except if there is fs corruption) error path
in gfs2_lookup_by_inum() if the call to gfs2_inode_refresh()
fails, it was leaving the function by calling iput() rather
than iget_failed(). This would cause future lookups of the same
inode to block forever.

This patch fixes the problem by moving the call to gfs2_inode_refresh()
into gfs2_inode_lookup() where iget_failed() is part of the error path
already. Also this cleans up some unreachable code and makes
gfs2_set_iop() static.

Signed-off-by: Steven Whitehouse swhit...@redhat.com

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 2232b3c..7aa7d4f 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -74,16 +74,14 @@ static struct inode *gfs2_iget(struct super_block *sb, u64 
no_addr)
 }
 
 /**
- * GFS2 lookup code fills in vfs inode contents based on info obtained
- * from directory entry inside gfs2_inode_lookup(). This has caused issues
- * with NFS code path since its get_dentry routine doesn't have the relevant
- * directory entry when gfs2_inode_lookup() is invoked. Part of the code
- * segment inside gfs2_inode_lookup code needs to get moved around.
+ * gfs2_set_iop - Sets inode operations
+ * @inode: The inode with correct i_mode filled in
  *
- * Clears I_NEW as well.
- **/
+ * GFS2 lookup code fills in vfs inode contents based on info obtained
+ * from directory entry inside gfs2_inode_lookup().
+ */
 
-void gfs2_set_iop(struct inode *inode)
+static void gfs2_set_iop(struct inode *inode)
 {
struct gfs2_sbd *sdp = GFS2_SB(inode);
umode_t mode = inode-i_mode;
@@ -106,8 +104,6 @@ void gfs2_set_iop(struct inode *inode)
inode-i_op = gfs2_file_iops;
init_special_inode(inode, inode-i_mode, inode-i_rdev);
}
-
-   unlock_new_inode(inode);
 }
 
 /**
@@ -119,10 +115,8 @@ void gfs2_set_iop(struct inode *inode)
  * Returns: A VFS inode, or an error
  */
 
-struct inode *gfs2_inode_lookup(struct super_block *sb,
-   unsigned int type,
-   u64 no_addr,
-   u64 no_formal_ino)
+struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
+   u64 no_addr, u64 no_formal_ino)
 {
struct inode *inode;
struct gfs2_inode *ip;
@@ -152,51 +146,37 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
  

[Cluster-devel] GFS2 update

2011-01-19 Thread Steven Whitehouse
Hi,

The merge window has now closed, I've pushed the pending patches
variously into -fixes and -nmw now. Once the -fixes have been merged,
I'll rebase -nmw.

The RCU glock patch is in -nmw and is even showing modest speed
improvements on postmark (which is single threaded) which is good,

Steve.




[Cluster-devel] [PATCH] fence_scsi: fix regular expression for grep

2011-01-19 Thread Ryan O'Hara
When fence_scsi checks to see if a specific keys is registered for a
specific device, it uses grep to look through a list of all registered
keys. The existing regular expression was not specific enough, and could
result in false positives. This patch fixes the problem by using anchors
to make the regular expression more specific.

Resolves: rhbz#670910

Signed-off-by: Ryan O'Hara roh...@redhat.com
---
 fence/agents/scsi/fence_scsi.pl |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 8ddde4e..818e1d9 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -71,7 +71,7 @@ sub do_action_off ($@)
log_error (device $dev does not exist) if (! -e $dev);
log_error (device $dev is not a block device) if (! -b $dev);
 
-   my @keys = grep { /$node_key/ } get_registration_keys ($dev);
+   my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
 
if (scalar (@keys) != 0) {
do_preempt_abort ($host_key, $node_key, $dev);
@@ -93,7 +93,7 @@ sub do_action_status ($@)
log_error (device $dev does not exist) if (! -e $dev);
log_error (device $dev is not a block device) if (! -b $dev);
 
-   my @keys = grep { /$node_key/ } get_registration_keys ($dev);
+   my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
 
if (scalar (@keys) != 0) {
$dev_count++;
-- 
1.7.3.4



Re: [Cluster-devel] [Lsf-pc] [ATTEND] Discuss Samba + RichACLs + clustered filesystem and support for CIFS/SMB2

2011-01-19 Thread Joel Becker
On Wed, Jan 19, 2011 at 12:23:08PM +, Steven Whitehouse wrote:
 On Tue, 2011-01-18 at 20:16 -0500, Ric Wheeler wrote:
  On 01/18/2011 05:36 PM, Jeremy Allison wrote:
   I (and Michael Adams and Volker Lendecke) would like to
   attend to discuss integration of Samba with Linux filesystems,
   ACL support and other Windows-style metadata support, and
   integration of Samba with Linux clustered filesystems.
 
 I think this would be a very useful topic to discuss. I've added the
 richacl developers to CC,

People like Samba on ocfs2 too, so we're definitely interested.

Joel


-- 



[Cluster-devel] [PATCH 2/2] fence_scsi: always do sg_turs before registration

2011-01-19 Thread Ryan O'Hara
If a node has been fenced, or its key has been forcibly removed from
device(s) by another node, the victim will see unit attention from the
devices if/when it attempts to re-register. This error is normally
reported just once, but will cause registration to fail. We can safely
avoid this by calling sg_turs prior to each attempt to register with a
device.

Resolves: rhbz#640343

Signed-off-by: Ryan O'Hara roh...@redhat.com
---
 fence/agents/scsi/fence_scsi.pl |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 818e1d9..10dc26a 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -46,6 +46,7 @@ sub do_action_on ($@)
log_error (device $dev does not exist) if (! -e $dev);
log_error (device $dev is not a block device) if (! -b $dev);
 
+   do_reset ($dev);
do_register_ignore ($node_key, $dev);
 
if (!get_reservation_key ($dev)) {
@@ -226,6 +227,23 @@ sub do_preempt_abort ($$$)
 return;
 }
 
+sub do_reset (S)
+{
+my $self = (caller(0))[3];
+my ($dev) = @_;
+
+my $cmd = sg_turs $dev;
+my @out = qx { $cmd 2 /dev/null };
+my $err = ($?8);
+
+## note that it is not necessarily an error is $err is non-zero,
+## so just log the device and status and continue.
+
+log_debug ($self (dev=$dev, status=$err));
+
+return;
+}
+
 sub key_read ()
 {
 my $self = (caller(0))[3];
-- 
1.7.3.4