Whamcloud - gitweb
EX-7601 osc: remove &pga usage in compress_request
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 21 Nov 2023 17:34:31 +0000 (12:34 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 24 Nov 2023 09:30:10 +0000 (09:30 +0000)
commitdda46f422e6beb2e2fc504fe323261455a652c5e
treeb867e339b7789e00d109947b408b569a57e59e37
parent5e6e241f23b84c83f05ebe9d3a9f113917ebf337
EX-7601 osc: remove &pga usage in compress_request

The usage of 'pga' and '&pga' in compress_request is
confusing, but also, compress_request modifies &pga by
allocating a new compressed page array.  Except if we fail
in compress_request, we free that new page array.

This means failing in compress_request replaces 'pga' with
a pointer to freed memory.  Instead, create an explicit
cpga pointer in the caller and use that.  This allows
compress_request to fail safely.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Idaf592103c57b0e9ce76ab520a69b819d4f37be9
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53120
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_compress.c
lustre/osc/osc_compress.h
lustre/osc/osc_request.c