From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 13 Feb 2019 08:21:28 -0700 Subject: [Cluster-devel] [GFS2 PATCH 7/9] gfs2: Check for log write errors and withdraw in rgrp_go_inval In-Reply-To: <20190213152130.8047-1-rpeterso@redhat.com> References: <20190213152130.8047-1-rpeterso@redhat.com> Message-ID: <20190213152130.8047-8-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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