[PATCH app/xfsinfo] Correctly report maximum request size when sizeof(long) != 4

Alan Coopersmith alan.coopersmith at oracle.com
Mon Sep 24 00:00:46 UTC 2018


The protocol spec says:
  The MAXIMUM-REQUEST-LENGTH specifies the largest request size in
  4-byte units that is accepted by the server

The code worked on 32-bit platforms, where longs were 4 bytes, but
overreports the number of bytes allowed on platforms with 64-bit longs.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xfsinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xfsinfo.c b/xfsinfo.c
index 4749967..9ed847d 100644
--- a/xfsinfo.c
+++ b/xfsinfo.c
@@ -144,8 +144,8 @@ print_server_info(FSServer *svr)
 	    printf(".%d", vendrel % 1000);
 	printf("\n");
     }
-    printf("maximum request size:	%ld longwords (%ld bytes)\n",
-	   FSMaxRequestSize(svr), FSMaxRequestSize(svr) * sizeof(long));
+    printf("maximum request size:	%ld words (%ld bytes)\n",
+	   FSMaxRequestSize(svr), FSMaxRequestSize(svr) * sizeof(CARD32));
     print_catalogue_info(svr);
     print_alternate_info(svr);
     print_extension_info(svr);
-- 
2.15.2



More information about the xorg-devel mailing list