[Devel] [PATCH] zdtm: print autofs request size, if read more than expected
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Wed Aug 23 15:43:54 MSK 2017
This is more debug patch, than fix. But valuable for debugging.
https://jira.sw.ru/browse/PSBM-70345
Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
test/zdtm/static/autofs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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)) {
More information about the Devel
mailing list