From 9304166380e0d997671c528ac3ed456704512a83 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 2 Mar 2012 14:55:04 -0600 Subject: [PATCH] viced: Do not ignore all InlineBulkStatus errors InlineBulkStatus currently returns 0 unconditionally, no matter what errors are encountered. If we encounter an error early enough, from CallPreamble for example, we do not fill in the OutStats nor CallBacks structures at all. Since we return success anyway, this results in the client getting AFSFetchStatus structures full of zeroes (or garbage, before commit 726e1e13ff93e2cc1ac21964dc8d906869e64406). Since current OpenAFS clients do not perform any sanity checks on the information received, this can result in cache corruption of files being seen incorrectly as empty, and, before commit 726e1e, more arbitrary corruption. So instead, return an error if we encounter an error before we iterate over the given FIDs. We still of course do not return an error for any errors encountered during the actual metadata retrieval, as those are reflected in the individual per-fid status structures. Reviewed-on: http://gerrit.openafs.org/6871 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot (cherry picked from commit 690a4c144b53fd1f3538d83017ecf581a2bcded5) Change-Id: Ide6bf179d3296d5105373f87052c0fb9df4fcacf Reviewed-on: http://gerrit.openafs.org/6958 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/viced/afsfileprocs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 970d34d75..17224b935 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -2983,6 +2983,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, volptr = (Volume *) 0; client = (struct client *)0; } + errorCode = 0; Bad_InlineBulkStatus: /* Update and store volume/vnode and parent vnodes back */ @@ -3015,7 +3016,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode, AUD_ID, t_client ? t_client->ViceId : 0, AUD_FIDS, Fids, AUD_END); - return 0; + return errorCode; } /*SRXAFS_InlineBulkStatus */ -- 2.39.5