From c72bf915ae25c9f785be318bfe4aab8468bfed8e Mon Sep 17 00:00:00 2001 From: Chris Kirby Date: Fri, 3 Oct 2025 14:01:39 -0500 Subject: [PATCH] Use ENOLINK as a special error code during forced unmount Tests such as quorum-heartbeat-timeout were failing with EIO messages in dmesg output due to expected errors during forced unmount. Use ENOLINK instead, and filter all errors from dmesg with this errno (67). Signed-off-by: Chris Kirby --- kmod/src/block.c | 4 ++-- kmod/src/format.h | 3 ++- kmod/src/net.c | 2 +- kmod/src/server.c | 2 +- kmod/src/trans.c | 4 ++-- tests/funcs/filter.sh | 3 +++ 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kmod/src/block.c b/kmod/src/block.c index e44a98a7..0fa35dcc 100644 --- a/kmod/src/block.c +++ b/kmod/src/block.c @@ -488,7 +488,7 @@ static int block_submit_bio(struct super_block *sb, struct block_private *bp, int ret = 0; if (scoutfs_forcing_unmount(sb)) - return -EIO; + return -ENOLINK; sector = bp->bl.blkno << (SCOUTFS_BLOCK_LG_SHIFT - 9); @@ -1210,7 +1210,7 @@ static int sm_block_io(struct super_block *sb, struct block_device *bdev, blk_op BUILD_BUG_ON(PAGE_SIZE < SCOUTFS_BLOCK_SM_SIZE); if (scoutfs_forcing_unmount(sb)) - return -EIO; + return -ENOLINK; if (WARN_ON_ONCE(len > SCOUTFS_BLOCK_SM_SIZE) || WARN_ON_ONCE(!op_is_write(opf) && !blk_crc)) diff --git a/kmod/src/format.h b/kmod/src/format.h index 4eab7a7b..07bb67aa 100644 --- a/kmod/src/format.h +++ b/kmod/src/format.h @@ -1091,7 +1091,8 @@ enum scoutfs_net_cmd { EXPAND_NET_ERRNO(ENOMEM) \ EXPAND_NET_ERRNO(EIO) \ EXPAND_NET_ERRNO(ENOSPC) \ - EXPAND_NET_ERRNO(EINVAL) + EXPAND_NET_ERRNO(EINVAL) \ + EXPAND_NET_ERRNO(ENOLINK) #undef EXPAND_NET_ERRNO #define EXPAND_NET_ERRNO(which) SCOUTFS_NET_ERR_##which, diff --git a/kmod/src/net.c b/kmod/src/net.c index 613cf169..8636452e 100644 --- a/kmod/src/net.c +++ b/kmod/src/net.c @@ -332,7 +332,7 @@ static int submit_send(struct super_block *sb, return -EINVAL; if (scoutfs_forcing_unmount(sb)) - return -EIO; + return -ENOLINK; msend = kmalloc(offsetof(struct message_send, nh.data[data_len]), GFP_NOFS); diff --git a/kmod/src/server.c b/kmod/src/server.c index 9dbd1509..cd978d27 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -610,7 +610,7 @@ static void scoutfs_server_commit_func(struct work_struct *work) goto out; if (scoutfs_forcing_unmount(sb)) { - ret = -EIO; + ret = -ENOLINK; goto out; } diff --git a/kmod/src/trans.c b/kmod/src/trans.c index 10494c43..d131bfa1 100644 --- a/kmod/src/trans.c +++ b/kmod/src/trans.c @@ -196,7 +196,7 @@ static int retry_forever(struct super_block *sb, int (*func)(struct super_block } if (scoutfs_forcing_unmount(sb)) { - ret = -EIO; + ret = -ENOLINK; break; } @@ -252,7 +252,7 @@ void scoutfs_trans_write_func(struct work_struct *work) } if (scoutfs_forcing_unmount(sb)) { - ret = -EIO; + ret = -ENOLINK; goto out; } diff --git a/tests/funcs/filter.sh b/tests/funcs/filter.sh index 294f9c72..b5a1a3cf 100644 --- a/tests/funcs/filter.sh +++ b/tests/funcs/filter.sh @@ -140,6 +140,9 @@ t_filter_dmesg() re="$re|scoutfs .* error.*server failed to bind to.*" re="$re|scoutfs .* critical transaction commit failure.*" + # ENOLINK (-67) indicates an expected forced unmount error + re="$re|scoutfs .* error -67 .*" + # change-devices causes loop device resizing re="$re|loop: module loaded" re="$re|loop[0-9].* detected capacity change from.*"