Whamcloud - gitweb
EX-7818 osc: don't do decomp. with compression disabled
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 4 Jul 2023 18:44:22 +0000 (14:44 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Jul 2023 04:11:59 +0000 (04:11 +0000)
decompress_request likely has a significant performance
cost for checking if data is compressed, so we should not
call it when compression is disabled.

This is a stop-gap solution for the preview until we can
have the server tell the client if data is compressed, as
described in EX-7818.

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

index 3566460..bc9559f 100644 (file)
@@ -40,6 +40,7 @@
 #include <lustre_dlm.h>
 #include <lustre_fid.h>
 #include <lustre_ha.h>
+#include <lustre_lib.h>
 #include <uapi/linux/lustre/lustre_ioctl.h>
 #include <lustre_net.h>
 #include <lustre_obdo.h>
@@ -2422,7 +2423,8 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                }
        }
 
-       if (rc >= 0 && lustre_msg_get_opc(req->rq_reqmsg) == OST_READ) {
+       if (rc >= 0 && lustre_msg_get_opc(req->rq_reqmsg) == OST_READ
+           && llite_enable_compression) {
                rc = decompress_request(aa, aa->aa_page_count);
                if (rc) {
                        CERROR("%s: Request can't be decompressed: rc = %d\n",