]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lockd: Stop warning on nlm__int__drop_reply in !V4 cast_status
authorChuck Lever <chuck.lever@oracle.com>
Tue, 12 May 2026 18:13:36 +0000 (14:13 -0400)
committerChuck Lever <cel@kernel.org>
Tue, 9 Jun 2026 20:32:59 +0000 (16:32 -0400)
cast_status folds internal lock-daemon sentinels into NLMv1/v3
wire status codes.  The !CONFIG_LOCKD_V4 variant warns when an
unrecognized status falls into the internal-sentinel range,
gated by be32_to_cpu(status) >= 30000.

nlm__int__drop_reply is defined as cpu_to_be32(30000), so it
sits at the lower edge of that range and trips pr_warn_once
("lockd: unhandled internal status %u").  The status is
returned unchanged so the reply is still dropped, but every
dropped reply on a !CONFIG_LOCKD_V4 build emits a spurious
warning.

Compare against nlm__int__drop_reply directly so the warning
still catches the genuinely unexpected sentinels deadlock,
stale_fh, and failed (30001 through 30003) but excludes the
legitimate dropped-reply marker.

Fixes: d343fce148a4 ("[PATCH] knfsd: Allow lockd to drop replies as appropriate")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svcproc.c

index c0a3487719e283c24816168a02097cbbedba5db6..110e186802b6cde2f4374f0282fd23d3d40a9adb 100644 (file)
@@ -49,7 +49,7 @@ static inline __be32 cast_status(__be32 status)
                status = nlm_lck_denied_nolocks;
                break;
        default:
-               if (be32_to_cpu(status) >= 30000)
+               if (be32_to_cpu(status) > be32_to_cpu(nlm__int__drop_reply))
                        pr_warn_once("lockd: unhandled internal status %u\n",
                                     be32_to_cpu(status));
                break;