linux/tools/net/sunrpc/xdrgen/templates/C
Chuck Lever 425364dc49 xdrgen: Fix code generated for counted arrays
When an XDR counted array has a maximum element count, xdrgen adds
a bounds check to the encoder or decoder for that type. But in cases
where the .x provides no maximum element count, such as

struct notify4 {
        /* composed from notify_type4 or notify_deviceid_type4 */
        bitmap4         notify_mask;
        notifylist4     notify_vals;
};

struct CB_NOTIFY4args {
        stateid4    cna_stateid;
        nfs_fh4     cna_fh;
        notify4     cna_changes<>;
};

xdrgen is supposed to omit that bounds check. Some of the Jinja2
templates handle that correctly, but a few are incorrect and leave
the bounds check in place with a maximum of zero, which causes
encoding/decoding of that type to fail unconditionally.

Reported-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2025-05-16 10:58:48 -04:00
..
constants
enum xdrgen: Add generator code for XDR width macros 2024-11-11 13:42:05 -05:00
header_bottom
header_top
pointer xdrgen: Fix code generated for counted arrays 2025-05-16 10:58:48 -04:00
program xdrgen: Remove program_stat_to_errno() call sites 2024-11-18 20:23:07 -05:00
source_top xdrgen: Update the files included in client-side source code 2024-11-18 20:23:06 -05:00
struct xdrgen: Fix code generated for counted arrays 2025-05-16 10:58:48 -04:00
typedef xdrgen: Add generator code for XDR width macros 2024-11-11 13:42:05 -05:00
union xdrgen: Fix code generated for counted arrays 2025-05-16 10:58:48 -04:00