From b4d832375066187527c8b072c387d2803bc1053a Mon Sep 17 00:00:00 2001 From: Chris Kirby Date: Wed, 15 Oct 2025 17:37:05 -0500 Subject: [PATCH] Quorum message cleanup Make sure to log an error if the SCOUTFS_QUORUM_EVENT_END update_quorum_block() call fails in scoutfs_quorum_worker(). Correctly print if the reader or writer failed when logging errors in update_quorum_block(). Signed-off-by: Chris Kirby --- kmod/src/quorum.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kmod/src/quorum.c b/kmod/src/quorum.c index 0e0fc7de..1c42188e 100644 --- a/kmod/src/quorum.c +++ b/kmod/src/quorum.c @@ -520,10 +520,10 @@ static int update_quorum_block(struct super_block *sb, int event, u64 term, bool set_quorum_block_event(sb, &blk, event, term); ret = write_quorum_block(sb, blkno, &blk); if (ret < 0) - scoutfs_err(sb, "error %d reading quorum block %llu to update event %d term %llu", + scoutfs_err(sb, "error %d writing quorum block %llu after updating event %d term %llu", ret, blkno, event, term); } else { - scoutfs_err(sb, "error %d writing quorum block %llu after updating event %d term %llu", + scoutfs_err(sb, "error %d reading quorum block %llu to update event %d term %llu", ret, blkno, event, term); } @@ -983,7 +983,10 @@ static void scoutfs_quorum_worker(struct work_struct *work) } /* record that this slot no longer has an active quorum */ - update_quorum_block(sb, SCOUTFS_QUORUM_EVENT_END, qst.term, true); + err = update_quorum_block(sb, SCOUTFS_QUORUM_EVENT_END, qst.term, true); + if (err < 0 && ret == 0) + ret = err; + out: if (ret < 0) { scoutfs_err(sb, "quorum service saw error %d, shutting down. This mount is no longer participating in quorum. It should be remounted to restore service.",