cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] gfs2: remove tr_num_revoke from assert clause
       [not found] <695632580.748759.1578339159724.JavaMail.zimbra@redhat.com>
@ 2020-01-06 19:33 ` Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2020-01-06 19:33 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Patch e955537e326 ("gfs2: eliminate tr_num_revoke_rm") made it
possible for tr_num_revoke to go negative. That's not a problem
because any given transaction can add a revoke for changed
metadata, but it may then remove several revoke bds that are
queued off the superblock. So it may remove more than it added.

However, this sometimes caused this assert:

fatal: assertion "(nbuf <= tr->tr_blocks) &&
   (tr->tr_num_revoke <= tr->tr_revokes)" failed
   function = gfs2_trans_end, file = gfs2/trans.c, line = 110

This patch makes tr_num_revoke a signed int rather than unsigned,
and it removes the tr_num_revoke clause from the assert.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/incore.h | 2 +-
 fs/gfs2/trans.c  | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index b5d9c11f4901..e09859384559 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -504,7 +504,7 @@ struct gfs2_trans {
 	unsigned int tr_num_databuf_new;
 	unsigned int tr_num_buf_rm;
 	unsigned int tr_num_databuf_rm;
-	unsigned int tr_num_revoke;
+	int tr_num_revoke;
 
 	struct list_head tr_list;
 	struct list_head tr_databuf;
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 4d01fe19c125..60369f9950e2 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -76,7 +76,7 @@ static void gfs2_print_trans(struct gfs2_sbd *sdp, const struct gfs2_trans *tr)
 	fs_warn(sdp, "blocks=%u revokes=%u reserved=%u touched=%u\n",
 		tr->tr_blocks, tr->tr_revokes, tr->tr_reserved,
 		test_bit(TR_TOUCHED, &tr->tr_flags));
-	fs_warn(sdp, "Buf %u/%u Databuf %u/%u Revoke %u\n",
+	fs_warn(sdp, "Buf %u/%u Databuf %u/%u Revoke %d\n",
 		tr->tr_num_buf_new, tr->tr_num_buf_rm,
 		tr->tr_num_databuf_new, tr->tr_num_databuf_rm,
 		tr->tr_num_revoke);
@@ -103,8 +103,7 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
 	nbuf -= tr->tr_num_buf_rm;
 	nbuf -= tr->tr_num_databuf_rm;
 
-	if (gfs2_assert_withdraw(sdp, (nbuf <= tr->tr_blocks) &&
-				       (tr->tr_num_revoke <= tr->tr_revokes)))
+	if (gfs2_assert_withdraw(sdp, (nbuf <= tr->tr_blocks)))
 		gfs2_print_trans(sdp, tr);
 
 	gfs2_log_commit(sdp, tr);



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-06 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <695632580.748759.1578339159724.JavaMail.zimbra@redhat.com>
2020-01-06 19:33 ` [Cluster-devel] [GFS2 PATCH] gfs2: remove tr_num_revoke from assert clause Bob Peterson

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).