cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH 3/9] gfs2: Empty the ail for the glock when rgrps are invalidated
Date: Wed, 13 Feb 2019 08:21:24 -0700	[thread overview]
Message-ID: <20190213152130.8047-4-rpeterso@redhat.com> (raw)
In-Reply-To: <20190213152130.8047-1-rpeterso@redhat.com>

Before this patch, function rgrp_go_inval would not invalidate the
ail list, which meant that there might still be buffers outstanding
on the ail that had revokes still pending. If the revokes had still
not been written when the glock was given to another node, and that
node (with outstanding revokes) died for some reason, the resulting
journal replay would replay the un-revoked rgrps, thus wiping out
changes made by the node who rightfully received the rgrp in EX.
This caused metadata corruption.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/glops.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 9c86c8004ba7..4b0e52bf5825 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -166,6 +166,8 @@ static void rgrp_go_sync(struct gfs2_glock *gl)
 	error = filemap_fdatawait_range(mapping, gl->gl_vm.start, gl->gl_vm.end);
 	mapping_set_error(mapping, error);
 	gfs2_ail_empty_gl(gl);
+	gfs2_assert_withdraw(gl->gl_name.ln_sbd,
+			     gl->gl_name.ln_sbd->sd_log_error == 0);
 
 	spin_lock(&gl->gl_lockref.lock);
 	rgd = gl->gl_object;
@@ -196,6 +198,7 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
 	WARN_ON_ONCE(!(flags & DIO_METADATA));
 	gfs2_assert_withdraw(sdp, !atomic_read(&gl->gl_ail_count));
 	truncate_inode_pages_range(mapping, gl->gl_vm.start, gl->gl_vm.end);
+	gfs2_ail_empty_gl(gl);
 
 	if (rgd)
 		rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
-- 
2.20.1



  parent reply	other threads:[~2019-02-13 15:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 15:21 [Cluster-devel] [GFS2 PATCH 0/9] GFS2: Withdraw corruption patches Bob Peterson
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 1/9] gfs2: Introduce concept of a pending withdraw Bob Peterson
2019-02-15 11:37   ` Steven Whitehouse
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 2/9] gfs2: Ignore recovery attempts if gfs2 has io error or is withdrawn Bob Peterson
2019-02-13 15:21 ` Bob Peterson [this message]
2019-02-15 11:47   ` [Cluster-devel] [GFS2 PATCH 3/9] gfs2: Empty the ail for the glock when rgrps are invalidated Steven Whitehouse
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 4/9] gfs2: Force withdraw to replay journals and wait for it to finish Bob Peterson
2019-02-15 11:55   ` Steven Whitehouse
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 5/9] gfs2: Keep transactions on ail1 list until after issuing revokes Bob Peterson
2019-02-15 11:56   ` Steven Whitehouse
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 6/9] gfs2: Make secondary withdrawers wait for first withdrawer Bob Peterson
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 7/9] gfs2: Check for log write errors and withdraw in rgrp_go_inval Bob Peterson
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 8/9] gfs2: Do log_flush in gfs2_ail_empty_gl even if ail list is empty Bob Peterson
2019-02-15 12:01   ` Steven Whitehouse
2019-02-13 15:21 ` [Cluster-devel] [GFS2 PATCH 9/9] dlm: recover slot regardless of whether we still have a connection Bob Peterson

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=20190213152130.8047-4-rpeterso@redhat.com \
    --to=rpeterso@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).