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 7/9] gfs2: Check for log write errors and withdraw in rgrp_go_inval
Date: Wed, 13 Feb 2019 08:21:28 -0700	[thread overview]
Message-ID: <20190213152130.8047-8-rpeterso@redhat.com> (raw)
In-Reply-To: <20190213152130.8047-1-rpeterso@redhat.com>

Before this patch, function rgrp_go_inval just assumed all the
writes submitted to the journal were finished and successful. But
if they're not, and a revoke fails to make its way to the journal,
a journal replay on another node will cause corruption if we
let the go_inval function continue and tell dlm to release the
glock to another node. This patch adds a couple assert_withdraws
in the rgrp_go_inval function. The assert should cause another
node to replay the journal before continuing, thus protecting the
rgrp glock and maintaining the integrity of the rgrp.

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

diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index f372a6f169a2..64b8e5e808d8 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -168,8 +168,7 @@ 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);
+	gfs2_assert_withdraw(sdp, gl->gl_name.ln_sbd->sd_log_error == 0);
 
 	spin_lock(&gl->gl_lockref.lock);
 	rgd = gl->gl_object;
@@ -202,6 +201,8 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
 	truncate_inode_pages_range(mapping, gl->gl_vm.start, gl->gl_vm.end);
 	gfs2_ail_empty_gl(gl);
 
+	gfs2_assert_withdraw(sdp, sdp->sd_log_error == 0);
+
 	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 ` [Cluster-devel] [GFS2 PATCH 3/9] gfs2: Empty the ail for the glock when rgrps are invalidated Bob Peterson
2019-02-15 11:47   ` 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 ` Bob Peterson [this message]
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-8-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).