cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: cmaiolino@redhat.com <cmaiolino@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] dlm: send_bast_queue() skip list loop not only sending basts to convertqueue
Date: Tue,  4 Jan 2011 18:06:51 -0200	[thread overview]
Message-ID: <1294171611-24786-1-git-send-email-cmaiolino@redhat.com> (raw)

From: Carlos Maiolino <cmaiolino@redhat.com>

with the current check condition: if (gr == lkb), the list will skip not only basts sent to convertqueue
since gr == lkb could be true on another situations, where such can cause a gfs2 corruption.

Corruption checked on gfs2 resource groups, adding a file on a node and removing the file on another node.
The resource groups got corrupted without this patch:

This is an output of the gfs2_edit without this patch:

Environment:
	-a two node cluster
	-gfs2 filesystem with 1G (counting journal space)
	- /dev/sda5             1.0G  259M  766M  26% /mnt (new fs after mkfs.gfs2)

- A new filesystem shared by two nodes:

RG #1 located at: 65551 (0x1000f)
  mh_magic              0x01161970(hex)
  mh_type               2                   0x2
  mh_format             200                 0xc8
  rg_flags              0                   0x0
  rg_free               64858               0xfd5a
  rg_dinodes            11                  0xb

- After fill the filesystem with just one file (a 764M file using dd) from node 1

RG #1 located at: 65551 (0x1000f)
  mh_magic              0x01161970(hex)
  mh_type               2                   0x2
  mh_format             200                 0xc8
  rg_flags              0                   0x0
  rg_free               18                  0x12
  rg_dinodes            12                  0xc

- After remove the file from the filesystem from node 2

RG #1 located at: 65551 (0x1000f)
  mh_magic              0x01161970(hex)
  mh_type               2                   0x2
  mh_format             200                 0xc8
  rg_flags              0                   0x0
  rg_free               18                  0x12
  rg_dinodes            12                  0xc

- The space of the filesystem is not freed:

[root at node2-vm stats]# df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda              1.0G  1.0G  216K 100% /mnt

- The problem also persists after umount the filesystem

- Applying the patch, the problem is not reproducible anymore and the resource group blocks are properly freed

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/dlm/lock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 64e5f3e..565c519 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1847,7 +1847,7 @@ static void send_bast_queue(struct dlm_rsb *r, struct list_head *head,
 
 	list_for_each_entry(gr, head, lkb_statequeue) {
 		/* skip self when sending basts to convertqueue */
-		if (gr == lkb)
+		if (head == &r->res_grantqueue && gr == lkb)
 			continue;
 		if (gr->lkb_bastfn && modes_require_bast(gr, lkb)) {
 			queue_bast(r, gr, lkb->lkb_rqmode);
-- 
1.7.1



             reply	other threads:[~2011-01-04 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 20:06 cmaiolino [this message]
2011-01-04 21:27 ` [Cluster-devel] [PATCH] dlm: send_bast_queue() skip list loop not only sending basts to convertqueue David Teigland
2011-01-05  9:46   ` Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294171611-24786-1-git-send-email-cmaiolino@redhat.com \
    --to=cmaiolino@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).