afs: Log weird 'size' fetchdata errors
[openafs.git] / src / afs / afs_fetchstore.c
index 3267aeb..f65f40c 100644 (file)
@@ -986,6 +986,14 @@ rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
              * in a signed 32-bit integer. If it is, we can't handle that, so
              * error out. */
            if (length64 > MAX_AFS_INT32) {
+                static int warned;
+                if (!warned) {
+                    warned = 1;
+                    afs_warn("afs: Warning: FetchData64 returned too much data "
+                             "(length64 %u.%u); this should not happen! "
+                             "Aborting fetch request.\n",
+                             length_hi, length);
+                }
                RX_AFS_GUNLOCK();
                 code = rx_EndCall(v->call, RX_PROTOCOL_ERROR);
                v->call = NULL;
@@ -1049,6 +1057,14 @@ rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
         * requested. It shouldn't do that, and accepting that much data
         * can make us take up more cache space than we're supposed to,
         * so error. */
+        static int warned;
+        if (!warned) {
+            warned = 1;
+            afs_warn("afs: Warning: FetchData64 returned more data than "
+                     "requested (requested %ld, got %ld); this should not "
+                     "happen! Aborting fetch request.\n",
+                     (long)size, (long)*alength);
+        }
        RX_AFS_GUNLOCK();
        code = rx_EndCall(v->call, RX_PROTOCOL_ERROR);
        RX_AFS_GLOCK();