X-Received: by 2002:a17:90a:4043:b0:1bc:450:df68 with SMTP id k3-20020a17090a404300b001bc0450df68mr867527pjg.120.1645479601531; Mon, 21 Feb 2022 13:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645479601; cv=none; d=google.com; s=arc-20160816; b=JFOHdJb49jOTXAAwX1PliqBiivECi3GS4v83f0jHbQva9j7sjSTjcxBjoHPfi1crYj 1hxMeIgBmvgKVgF1v4sN78xiz0katRDxtMBARa+1jkTwh+YTVd6v8VGsqtFBSEpYODb1 +G8gH+jgDvT0ALHQnXWE3CBXipBR251oX/UXcnW2KMrDeQIlxNIOUF8bAC8+Qe0rXa+S Wsx5lziCXc8sZtChxkD12b7ozoRCXHPAiOl7HrtUTaQa79mGJtLMBHppX8rgJxiuf9gc JAnwsYd32PzYAhWuBoT/H/r25WFFPOyj2USJeBZMcZYKgeJ4N3VMUov1LMKT1Di6T3K9 auYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sSv0HmTBvPQGGsw5gnGusdRvXA7M0AM7UlCxqCT2e9g=; b=dcwh3RrdvaubIVaTP85pdJ0eRahnzzeS7k3r/TyXjj9X2CBTQyXMLdmqy7fKMps4xM H+trZE2g2ekDe6LhG4DofzOEVnYq3TsbDs04c5aY0e1O6dGUOkH3JImmT5jdUy4bsTl+ G5gb7CP5Hc2UIxJlOUp1KdGMKZ97SimcbfqK2vwAetlGH83MF2hKBYunCW0rnc82oTkh gRcVhhTBCzD9n3RRiKWpEq3eZ2TqSv4dxZzHqY5hXfIyTUBE8y64SBpUauuL6guArVq+ Y8gTs5bYCkIDlcyNYKPH7ZWob0p7pNEi8WF0arAMIyF4saG8Re2jjbMnhiqfMHpR/sHU eXJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g68thwJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5si9658454pga.558.2022.02.21.13.39.46; Mon, 21 Feb 2022 13:40:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g68thwJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348701AbiBUJLg (ORCPT + 99 others); Mon, 21 Feb 2022 04:11:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347594AbiBUJHG (ORCPT ); Mon, 21 Feb 2022 04:07:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BED8B26559; Mon, 21 Feb 2022 00:59:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 60908B80E72; Mon, 21 Feb 2022 08:59:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98A34C340EB; Mon, 21 Feb 2022 08:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433990; bh=OSHo2PJpIYtB2DIHy0v4CkW2SRFnO9seM4Vk8G09WJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g68thwJ+7dv2NFCxMA5oYOJ9I+Xveu3XhpxqnzGnW6PNr7UCPA/RhXeOd/DUm+KI9 Z4memPoVhvInZqFRacDDQdsXR46uDpxGqRxWUGKDzM0vgOh4b+K9hVfWlMJsu3U3qK S66Zs5COmJSsuz0g2MJF46tosML+52ua212nImCI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Xu , Shuah Khan , Sasha Levin Subject: [PATCH 5.4 12/80] selftests/zram: Skip max_comp_streams interface on newer kernel Date: Mon, 21 Feb 2022 09:48:52 +0100 Message-Id: <20220221084915.993795854@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Xu [ Upstream commit fc4eb486a59d70bd35cf1209f0e68c2d8b979193 ] Since commit 43209ea2d17a ("zram: remove max_comp_streams internals"), zram has switched to per-cpu streams. Even kernel still keep this interface for some reasons, but writing to max_comp_stream doesn't take any effect. So skip it on newer kernel ie 4.7. The code that comparing kernel version is from xfstests testsuite ext4/053. Signed-off-by: Yang Xu Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/zram/zram_lib.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh index 6f872f266fd11..f47fc0f27e99e 100755 --- a/tools/testing/selftests/zram/zram_lib.sh +++ b/tools/testing/selftests/zram/zram_lib.sh @@ -11,6 +11,9 @@ dev_mounted=-1 # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +kernel_version=`uname -r | cut -d'.' -f1,2` +kernel_major=${kernel_version%.*} +kernel_minor=${kernel_version#*.} trap INT @@ -25,6 +28,20 @@ check_prereqs() fi } +kernel_gte() +{ + major=${1%.*} + minor=${1#*.} + + if [ $kernel_major -gt $major ]; then + return 0 + elif [[ $kernel_major -eq $major && $kernel_minor -ge $minor ]]; then + return 0 + fi + + return 1 +} + zram_cleanup() { echo "zram cleanup" @@ -86,6 +103,13 @@ zram_max_streams() { echo "set max_comp_streams to zram device(s)" + kernel_gte 4.7 + if [ $? -eq 0 ]; then + echo "The device attribute max_comp_streams was"\ + "deprecated in 4.7" + return 0 + fi + local i=0 for max_s in $zram_max_streams; do local sys_path="/sys/block/zram${i}/max_comp_streams" -- 2.34.1