From nobody Tue Dec 2 02:38:02 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 346872DF717 for ; Tue, 18 Nov 2025 19:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763495630; cv=none; b=LBPPtypt5RI4rVmfnjgiM3KuxrLdcYtQKTdxqqGXAsCeyhS7vUXlznrBUxXuCYSoxtM/NQKt0o6BBzCUJwHQL0ZxghtU7fcW6RMgG3w+7ph6yrMURthx4hcXx7BLoRxH5rzzAt5AgyOAG0ttNG77mBKZGybnooAmUWoPyM6nVTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763495630; c=relaxed/simple; bh=3kk21AVR0BUcua2zkddv676b0sKfxa6DENI/ptrFn4Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tv8vEeDU3X2EqWVr5Z66OwzRBatc6sehUPwN0LxjGgWB2xfXbFzSMnrJ9/mLsd5CZbVV9pkF0JsXDf8PHVNGWpwvETW3WKPoDtNR5ctrf+07E6gX6ycp54LIcNlTnMUZ5feUaBCI1qv/kcuar+2E7xpVIZpPVBbqJwzVU/SsWj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QDty9WFq; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QDty9WFq" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2980d9b7df5so62962085ad.3 for ; Tue, 18 Nov 2025 11:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763495628; x=1764100428; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5SpKL5XOhSd8b79ER6CmdySWzSN2pcIo7OGXrr04v0U=; b=QDty9WFqmuaXBEv5vCBVmOOmmEZ6bbqbT4EymEHkKZdPvLYqQ9qVFoL1R0n/10Iq+1 EZyK/WAhaVUYJwhcsrOBuPHPjDNg2eQDavrnngPKtaNsdc99xzmmo3lfW5PN0OFZzl1Y XmrgBjFivuTHeeggCITF7i2vZ7PL5XR8FTOcjXsuFUx7YSiEwwpTItTAx8su4RBJMZW7 Fo4W+L/iroiUZwh1RJsagm9PtlQGUQuFhT6QGmH+bYRizcvNMlPMmS6Y4xseWivkM/zI aLkMSRHFX0iGqmG2Dsk6faNBWDHVgiXdyPmIULPhPAR9er9JJMDM7jDbW2y+QRISN7FJ A4Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763495628; x=1764100428; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5SpKL5XOhSd8b79ER6CmdySWzSN2pcIo7OGXrr04v0U=; b=Fvud3wB93prtllAo67Jqr8gXnja9T0/QyEZ+h0DLv3rGDS/ADWP5Z9fn+5+T6hqrJB OgaWYATr/VbAyoRNaHcx5Y12Hgy+bhoGNGbX4Q2qoZOjCBznKgQw9c+8G6T3EqQfkFAb 6AP2UzP6ZPVo3xvtYICCvyfijQlXeYE3Sd4botNoAu84MTRxLVLhXPjuttD2D8zOfZvY +JsWc7lTMb6D4IwYM7b6GmrSg1e7+KJQ+Tgj4SyakndTboa07Ga4NYZWhbHon5bpM7ba 1S9SmlSr8dLkrI7jbhlxbZHEcsAwZuExzh10k74PCzl8zZUgrLr7bsaG1+A8fAi5sb47 EGhg== X-Forwarded-Encrypted: i=1; AJvYcCWA8vV5gpvvPu6Fn44JaDgN+cnzKK7BEZUDb4DbnIkgS8zLijiRz5nemzO5/P0yc6Hpr9SQVtgEWRYexWI=@vger.kernel.org X-Gm-Message-State: AOJu0YzIsGH5orHHDvH3v42BL9l9cjRQyuSeN5jU/n1+V43Z3MuWAZbg wboj0EKaRDU7R/OuoaNMQVhiThg+gd06VKbXie+P80cYa5H+m4Fz9CPn X-Gm-Gg: ASbGncsBLH92QywI64zvMy6m9XaEvIVYOugkq8nzZpaDE8sLZ/VGd0IsYR1oNJK+89r rfBm2GFEjPC9GnBB0sL1lMg6dux7vp7QslEsiG4AmTsPVI67TOJkY4YOyNEnhD6ehDA9mFYBDm8 +h2luQ495E5fjoxReyd0UNv0nYcgwniX0CVGkRWCgCaja0saF9dpFeSDkBrpgrrOsp+nzmTgsHm iKAIn0cJIaJa+8rs3rvcUcML0ISdB9U68ZJ/kzF7aRPBqpsvUz79J1NxfkwgvIy85jpFIVvtPJm HxyLs6/PAiWwlD4uMvvHKElESECnxnBU01BsjGGR50S3VP0n+3ENEgAaur68bsQI6szwgBMcYtX 5hcTnWeoWlgqx1WBz2gPGst017CVVnJzGHsAT4j9WBPjXMbs333iAskKCTHWdsMtficaYRVENqW uFt+uQD7b52Q== X-Google-Smtp-Source: AGHT+IG73H9fMzBHLW9z64tVvn4pTF1swZZsbvhjuhF9VgeDf0MxRI4T4My4bdGDW+hWCxUACqwVuw== X-Received: by 2002:a17:902:ebd2:b0:294:fc1d:9d0 with SMTP id d9443c01a7336-2986a750101mr220915645ad.40.1763495628422; Tue, 18 Nov 2025 11:53:48 -0800 (PST) Received: from snowman ([2401:4900:647d:8da9:4ba8:dd95:deb3:d9e4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2985c2346f3sm183220085ad.18.2025.11.18.11.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 11:53:47 -0800 (PST) From: Khushal Chitturi To: chuck.lever@oracle.com, jlayton@kernel.org Cc: neil@brown.name, okorniev@redhat.com, Dai.Ngo@oracle.com, tom@talpey.com, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Khushal Chitturi Subject: [PATCH] xdrgen: improve error reporting for invalid void declarations Date: Wed, 19 Nov 2025 01:22:58 +0530 Message-ID: <20251118195258.6497-1-kc9282016@gmail.com> X-Mailer: git-send-email 2.51.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" RFC 4506 defines void as a zero-length type that may appear only as union arms or as program argument/result types. It cannot be declared with an identifier, so constructs like "typedef void temp;" are not valid XDR. Previously, xdrgen raised a NotImplementedError when it encountered a void declaration in a typedef. Which was misleading, as the problem is an invalid RPC specification rather than missing functionality in xdrgen. This patch replaces the NotImplementedError for _XdrVoid in typedef handling with a clearer ValueError that specifies incorrect use of void in the XDR input, making it clear that the issue lies in the RPC specification being parsed. Signed-off-by: Khushal Chitturi --- tools/net/sunrpc/xdrgen/generators/typedef.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/net/sunrpc/xdrgen/generators/typedef.py b/tools/net/sunr= pc/xdrgen/generators/typedef.py index fab72e9d6915..75e3a40e14e1 100644 --- a/tools/net/sunrpc/xdrgen/generators/typedef.py +++ b/tools/net/sunrpc/xdrgen/generators/typedef.py @@ -58,7 +58,7 @@ def emit_typedef_declaration(environment: Environment, no= de: _XdrDeclaration) -> elif isinstance(node, _XdrOptionalData): raise NotImplementedError(" typedef not yet impleme= nted") elif isinstance(node, _XdrVoid): - raise NotImplementedError(" typedef not yet implemented") + raise ValueError("invalid void usage in RPC Specification") else: raise NotImplementedError("typedef: type not recognized") =20 @@ -104,7 +104,7 @@ def emit_type_definition(environment: Environment, node= : _XdrDeclaration) -> Non elif isinstance(node, _XdrOptionalData): raise NotImplementedError(" typedef not yet impleme= nted") elif isinstance(node, _XdrVoid): - raise NotImplementedError(" typedef not yet implemented") + raise ValueError("invalid void usage in RPC Specification") else: raise NotImplementedError("typedef: type not recognized") =20 @@ -165,7 +165,7 @@ def emit_typedef_decoder(environment: Environment, node= : _XdrDeclaration) -> Non elif isinstance(node, _XdrOptionalData): raise NotImplementedError(" typedef not yet impleme= nted") elif isinstance(node, _XdrVoid): - raise NotImplementedError(" typedef not yet implemented") + raise ValueError("invalid void usage in RPC Specification") else: raise NotImplementedError("typedef: type not recognized") =20 @@ -225,7 +225,7 @@ def emit_typedef_encoder(environment: Environment, node= : _XdrDeclaration) -> Non elif isinstance(node, _XdrOptionalData): raise NotImplementedError(" typedef not yet impleme= nted") elif isinstance(node, _XdrVoid): - raise NotImplementedError(" typedef not yet implemented") + raise ValueError("invalid void usage in RPC Specification") else: raise NotImplementedError("typedef: type not recognized") =20 --=20 2.51.2