Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2370301rdf; Mon, 6 Nov 2023 12:03:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRoeftFCScJkINf7q9yaGprr4gna6ihoXhMjyLW3zJ3QGvCOcP1wJsBii24v51OtGriOvf X-Received: by 2002:a05:6a00:1515:b0:68e:4303:edb8 with SMTP id q21-20020a056a00151500b0068e4303edb8mr37987137pfu.30.1699301034267; Mon, 06 Nov 2023 12:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699301034; cv=none; d=google.com; s=arc-20160816; b=oHz0bmqsPrUbsxuPLkoLD0+XCC7/Yh6NnLMy/VZr6aHobKZgW9rAY3cV2tA0aFjjmZ OgLuzCSMKzsxnZGJ5vJQ1rVEaaKXYB20eQDj7pPtwh6pcurSgsGPoG+BGNKtnFGc4gW6 Le+b9nuXtaw4JJDvVLpzs6nN/yK7gQkjPnSpSSeFMgObKPUHTMiLLdOcd5w9yrPLB8j7 zsY2djGZSGg/0lemh7BvUV31TQ69BNnKwHR7m2GBH+j7JKsXuTUm1Om2bA39Iph2O8VR lwiBsIcnoFDVgkcWtU786dwRfyerD0IbR5mp3eZgOgbaS30tbNGfQCRTQZK+CFxplZs6 3kHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:mime-version:date:dkim-signature:message-id; bh=phlU4gV4Aft/tjiYrtjDOJr6Ls/Rl5IpOB+DSxP4KLc=; fh=xlqUB/qUfq6Wucj1GJj9gGkLZlZKWhc3o9dxAjJZNE8=; b=KYqCgMkjcX8PTg2qwfP5UMCb7pjgc/FZjq+Kdw9xreMtEAdBF/6EYGilcntfibrVTp pNivFdAGcR25ySdOS4yhuBxamrKFVq11GX4TBua6sj73rMpx4ap+Rqnm60JyBhyLD6FG oTMT4UjorRjnv3IXZjlaHH4bFeSIaKFRTyWPpZPLkphpjeLrhthXnbv2KNnnaU5wX19h p4yLlMYE2Z1ieuXH5g1gaSjsnCsiusbpFVV19AruqEnC54rEVsy4zs+rhsQdlz6kdcsz NdzITD0vH1fHOhVvAV0XsumBaVGVscLLCnwWI75PnW7rVfztgMzwJTW8RWDxfQ+edTGw YwYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xZQwR1W7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b15-20020a056a00114f00b00690da053918si8730689pfm.4.2023.11.06.12.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 12:03:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xZQwR1W7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 449F580C6DCD; Mon, 6 Nov 2023 12:03:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbjKFUDf (ORCPT + 99 others); Mon, 6 Nov 2023 15:03:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231483AbjKFUDf (ORCPT ); Mon, 6 Nov 2023 15:03:35 -0500 X-Greylist: delayed 540 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 06 Nov 2023 12:03:32 PST Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [IPv6:2001:41d0:203:375::b7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185A71BF for ; Mon, 6 Nov 2023 12:03:32 -0800 (PST) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1699300519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=phlU4gV4Aft/tjiYrtjDOJr6Ls/Rl5IpOB+DSxP4KLc=; b=xZQwR1W75ReIaJ8QXWSP7HwDPs0OJKfjtfTYVK6q9TY2bH0x9z7cbpyRf35O3yseKlwgHX zoOd8CU1UJ+S9G37A3Xb4p+m05SrUJhAqvRc057IXSlxd0+ssH7UawYdv/BhUtikMNFBQv w0Z1hI0W4IEXmGMex3X8wOEc4KQOqus= Date: Mon, 6 Nov 2023 22:55:19 +0300 MIME-Version: 1.0 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vasily Averin Subject: [PATCH] zram: extra zram_get_element call in zram_read_from_zspool() To: Sergey Senozhatsky , Minchan Kim Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, zhouxianrong Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 06 Nov 2023 12:03:48 -0800 (PST) 'element' and 'handle' are union in struct zram_table_entry. Fixes: 8e19d540d107 ("zram: extend zero pages to same element pages") Signed-off-by: Vasily Averin --- drivers/block/zram/zram_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 9ac3d4e51d26..f4d342d11b81 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1318,12 +1318,10 @@ static int zram_read_from_zspool(struct zram *zram, struct page *page, handle = zram_get_handle(zram, index); if (!handle || zram_test_flag(zram, index, ZRAM_SAME)) { - unsigned long value; void *mem; - value = handle ? zram_get_element(zram, index) : 0; mem = kmap_atomic(page); - zram_fill_page(mem, PAGE_SIZE, value); + zram_fill_page(mem, PAGE_SIZE, handle); kunmap_atomic(mem); return 0; } -- 2.34.1