viced: Do error translation for InlineBulkStatus
[openafs.git] / src / viced / afsfileprocs.c
index c761817..66a4b12 100644 (file)
@@ -2688,7 +2688,13 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids,
                              &parentwhentargetnotdir, &client, READ_LOCK,
                              &rights, &anyrights))) {
            tstatus = &OutStats->AFSBulkStats_val[i];
-           tstatus->errorCode = errorCode;
+
+           if (thost->hostFlags & HERRORTRANS) {
+               tstatus->errorCode = sys_error_to_et(errorCode);
+           } else {
+               tstatus->errorCode = errorCode;
+           }
+
            PutVolumePackage(acall, parentwhentargetnotdir, targetptr,
                             (Vnode *) 0, volptr, &client);
            parentwhentargetnotdir = (Vnode *) 0;
@@ -2712,7 +2718,13 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids,
                 Check_PermissionRights(targetptr, client, rights,
                                        CHK_FETCHSTATUS, 0))) {
                tstatus = &OutStats->AFSBulkStats_val[i];
-               tstatus->errorCode = errorCode;
+
+               if (thost->hostFlags & HERRORTRANS) {
+                   tstatus->errorCode = sys_error_to_et(errorCode);
+               } else {
+                   tstatus->errorCode = errorCode;
+               }
+
                (void)PutVolumePackage(acall, parentwhentargetnotdir,
                                       targetptr, (Vnode *) 0, volptr,
                                       &client);
@@ -2749,6 +2761,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 */
@@ -2765,7 +2778,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 */