From 8ca1b87d0804b23e32304742297701960489f1b4 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 11 May 2018 15:44:24 -0400 Subject: [PATCH] viced: SRXAFS_InlineBulkStatus set InterfaceVersion on error AFSFetchStatus.InterfaceVersion is required to be "1" for any of the fields in the structure to be considered valid. Therefore, InterfaceVersion must be set to one when returning an 'errorCode' value. When RXAFS_InlineBulkStatus was introduced by OpenAFS in 362d26c733b086d26f013bd229af979a112098f5 not only wasn't InterfaceVersion set but neither was the memory allocated to OutStats initialized. As a result the InterfaceVersion field value could be not only zero but random. The OutStats memory was initialized to zeros beginning with 726e1e13ff93e2cc1ac21964dc8d906869e64406. Reviewed-on: https://gerrit.openafs.org/13067 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f045de21a45fcc8f71e2b30e826c22c8a7b4d0f2) Change-Id: I0d15147081f6e8744680c16e43b22075070647e4 Reviewed-on: https://gerrit.openafs.org/13117 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk --- src/viced/afsfileprocs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index ea1164092..6c7cad1ff 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -2753,6 +2753,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, &rights, &anyrights))) { tstatus = &OutStats->AFSBulkStats_val[i]; + tstatus->InterfaceVersion = 1; if (thost->z.hostFlags & HERRORTRANS) { tstatus->errorCode = sys_error_to_et(errorCode); } else { @@ -2781,6 +2782,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, CHK_FETCHSTATUS, 0))) { tstatus = &OutStats->AFSBulkStats_val[i]; + tstatus->InterfaceVersion = 1; if (thost->z.hostFlags & HERRORTRANS) { tstatus->errorCode = sys_error_to_et(errorCode); } else { -- 2.39.5