From 03e22164db34eb65ea041a289d48ee890677d690 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 19 Feb 2026 14:00:16 -0800 Subject: [PATCH 1/4] Return error on scoutfs_forest_setup(). This setup function always returned 0, even on error, causing initialization to continue despite the error. Signed-off-by: Auke Kok --- kmod/src/forest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/forest.c b/kmod/src/forest.c index 0e5c31d3..306f4841 100644 --- a/kmod/src/forest.c +++ b/kmod/src/forest.c @@ -793,7 +793,7 @@ out: if (ret) scoutfs_forest_destroy(sb); - return 0; + return ret; } void scoutfs_forest_start(struct super_block *sb) From 7d96cf9b969d15cc5285b960255a357fd9bd682c Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 19 Feb 2026 14:01:28 -0800 Subject: [PATCH 2/4] Remove copy/paste duplicate op flag check. The exact 2 lines here are repeated. It suggests that there may have been the intent of an additional check, but, there isn't anything left from what I can see that needs checking here. Signed-off-by: Auke Kok --- kmod/src/ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c index 7a73d4de..ea31321c 100644 --- a/kmod/src/ioctl.c +++ b/kmod/src/ioctl.c @@ -415,8 +415,6 @@ static long scoutfs_ioc_data_wait_err(struct file *file, unsigned long arg) return 0; if ((args.op & SCOUTFS_IOC_DWO_UNKNOWN) || !IS_ERR_VALUE(args.err)) return -EINVAL; - if ((args.op & SCOUTFS_IOC_DWO_UNKNOWN) || !IS_ERR_VALUE(args.err)) - return -EINVAL; trace_scoutfs_ioc_data_wait_err(sb, &args); From 43f3dd72599ec0f8ccb96bbe12538b12ff0ffd3b Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 19 Feb 2026 14:04:55 -0800 Subject: [PATCH 3/4] Invalid address check logic. These boolean checks are all mutually exclusive, meaning this check will always succeed due to the negative. Instead of && it needs to use ||. Signed-off-by: Auke Kok --- kmod/src/quorum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmod/src/quorum.c b/kmod/src/quorum.c index 242804ed..fc25904e 100644 --- a/kmod/src/quorum.c +++ b/kmod/src/quorum.c @@ -1195,8 +1195,8 @@ static struct attribute *quorum_attrs[] = { static inline bool valid_ipv4_unicast(__be32 addr) { - return !(ipv4_is_multicast(addr) && ipv4_is_lbcast(addr) && - ipv4_is_zeronet(addr) && ipv4_is_local_multicast(addr)); + return !(ipv4_is_multicast(addr) || ipv4_is_lbcast(addr) || + ipv4_is_zeronet(addr) || ipv4_is_local_multicast(addr)); } static inline bool valid_ipv4_port(__be16 port) From eaae92d983f1f1aba1386ddd2c5e6bc2385a37fb Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 19 Feb 2026 14:12:51 -0800 Subject: [PATCH 4/4] Don't send -EINVAL as u8, over the network. The caller sends the return value of this inline as u8. If we return -EINVAL, it maps to (234) which is outside of our enum range. Assume this was meant to return SCOUTFS_NET_ERR_EINVAL which is a defined constant. Signed-off-by: Auke Kok --- kmod/src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/net.c b/kmod/src/net.c index 4c22e8ea..8e7cdb4c 100644 --- a/kmod/src/net.c +++ b/kmod/src/net.c @@ -336,7 +336,7 @@ static inline u8 net_err_from_host(struct super_block *sb, int error) error); } - return -EINVAL; + return SCOUTFS_NET_ERR_EINVAL; } return net_errs[ind];