Whamcloud - gitweb
LU-13499 obd: fix printing of client connection UUID 43/38443/2
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 1 May 2020 08:02:22 +0000 (02:02 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 14 May 2020 05:39:34 +0000 (05:39 +0000)
commit9abdf96e56e239b81102c8a43dc2f0524f2be90a
treee91ef12081ecac9064eeedfb3807f088309096d8
parentcb74546354201434a6fd3d53acd1a0808fbfcb1c
LU-13499 obd: fix printing of client connection UUID

The client connection UUID sent to the servers (ASCII format) was
being truncated to only 16 bytes in size, like '595f3c6a-20ae-4'
instead of a full UUID like '18ae0f9a-4b09-4599-8ced-0f2126eab425'.

This was caused by using UUID_SIZE to limit the size of the "%pU"
string printed to avoid overflowing the target buffer, but in fact
UUID_SIZE is the size of the binary uuid_t (16 bytes) instead of
the size of struct obd_uuid (40 bytes) where the ASCII version of
the UUID is stored.

Fix this to use sizeof(target) rather than an external constant,
which is exactly why sizeof(target) should always be used.  The
usage in osd_scrub.c is not actually broken, but it is still
better to use sizeof(target) to avoid future inconsistencies.

Fixes: 604c266a175b7 ("LU-11803 obd: replace class_uuid with linux kernel version")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I05325646cd632a09997d6632a483909629ce7057
Reviewed-on: https://review.whamcloud.com/38443
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_lib.c
lustre/obdclass/obd_mount.c
lustre/osd-ldiskfs/osd_scrub.c