[Devel] zdtm: print autofs request size, if read more than expected

Submitted by Stanislav Kinsburskiy on Aug. 23, 2017, 12:43 p.m.

Details

Message ID 20170823124343.60629.36395.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "zdtm: print autofs request size, if read more than expected"
Headers show

Commit Message

Stanislav Kinsburskiy Aug. 23, 2017, 12:43 p.m.
This is more debug patch, than fix. But valuable for debugging.

https://jira.sw.ru/browse/PSBM-70345

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 test/zdtm/static/autofs.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c
index 747ab69..d854fd0 100644
--- a/test/zdtm/static/autofs.c
+++ b/test/zdtm/static/autofs.c
@@ -460,7 +460,7 @@  static int automountd_loop(int pipe, const char *mountpoint, struct autofs_param
 {
 	union autofs_v5_packet_union *packet;
 	ssize_t bytes;
-	size_t psize = sizeof(*packet) + 1;
+	size_t psize = sizeof(*packet) * 2;
 	int err = 0;
 
 	packet = malloc(psize);
@@ -483,8 +483,8 @@  static int automountd_loop(int pipe, const char *mountpoint, struct autofs_param
 			}
 			continue;
 		}
-		if (bytes == psize) {
-			pr_err("read more that expected\n");
+		if (bytes > psize) {
+			pr_err("read more that expected: %ld > %ld\n", bytes, psize);
 			return -EINVAL;
 		}
 		if (bytes != sizeof(*packet)) {