From patchwork Sun Mar 19 07:51:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13180244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1AB5CC6FD1F for ; Sun, 19 Mar 2023 07:52:04 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pdnpg-0003N4-Hc; Sun, 19 Mar 2023 07:52:01 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pdnpe-0003Mx-Kq for linux-f2fs-devel@lists.sourceforge.net; Sun, 19 Mar 2023 07:51:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VUWwBkzOfM1kB3c/5VYdcEvnLFhDOME4sOKTv0gGYpM=; b=lv0IPTuryLi/RB9t0LFFkIaKYO YlFI808y6YT6Vr33VIKhOneW6R9UK7iBAjpnIuwrvtFHicuR4Baig6ewJ0FrSU9x6+FZHKn4Le1Tn y9H1vLnF73FhTIFcD5MQO9e5fW0ZtGdRKpowiNHOaOT+uCsSk7WmR3RGTOYIz+07Q5zM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=VUWwBkzOfM1kB3c/5VYdcEvnLFhDOME4sOKTv0gGYpM=; b=W kXf0wUwOe6qYJ6Zw5f6KVfl6MaqPgKp2ai8NhK1ii4RucHQgc58GdxSKdz3/bpCcgntKFFQdvBCTq Ow2GrCGyjAJCRPP5DqCkvSEetSUkVArYPqSxITpEndQaGQzlaEmGPWLk2sJ8U2Nnvo6jJKqRrLddE I2aL05XAqlae0OQ4=; Received: from mail-tyzapc01on2110.outbound.protection.outlook.com ([40.107.117.110] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pdnpb-00DJkh-EC for linux-f2fs-devel@lists.sourceforge.net; Sun, 19 Mar 2023 07:51:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbAONHybI8u8v5fs7gkwHN6KIARK48us/fwPo6fPtaAhCULkmvnoQx7A8x5FppOzprcfLPEDT1DbQedLJRQoFreI+hcvSe2zk64VNoysTBhsAxM6nciNIyEO0tRvdZmbv8cCFagCoHkAFMxCaGHAVJ58lEIjUUak117Jvi8cUIMQsQFGptLrzjZtX3aOkwMWXPSC2asPUagCNY33PaSI2bI1cpd2GtjqTYEN057OVhN6P/5NCZZW8BGvzikjl1wsvhiIYejn2Ul4jJeyj6oJSG/igs58yM3ZbQzv2f7CV5rwwQiWA8odl1SysFOstRKRLpUKOKcMMwcqpHt8SSx83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VUWwBkzOfM1kB3c/5VYdcEvnLFhDOME4sOKTv0gGYpM=; b=Mzz6Y50+vsfvbYtIKhnWWqO8yCIU0prZ9fd3WWiq+kHid7SIJWoGgWxgPhisAvLuHKVcdWfOZEyP0P5EFy+XempPFCjBEW7pvIdCjdnh67Wnx0hNVoqAt9GqfQwf5ARmfi9olecP766dAmRQ7d4nlBGnZA0C7bJag6Sp7xbXO9EUIFUN6poSO06g4Rp5lxDL/f8Ai6jy9B4Vf63YxoSKUQxnhb4OcsPi8NAag3/p4Ybcvwo3TjFQXox28NzAOook+3FiHIsXMRzD5sYePEJB2B0qjM980N8ZfVkcAmohfMuWWFsw131V//nujyIU00LMUyq5+VEzmeXHKaQcqP8K3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VUWwBkzOfM1kB3c/5VYdcEvnLFhDOME4sOKTv0gGYpM=; b=Varn4LiMc1vDpxyVjT19E9aCEdc7uQBeUoORfPLdo921+QdzUqEPOXBRDbdALc3b0RmBm+Mw/nHuUBTQZ55Or19xSspOo9+SXomuFm6Igd5wZu3CEjZVKuRpdaekOndfHSXKenIBuRHlmIEva4svyJlbKlHWVCXJE07BxO1ml6uquQFLNzghPy6nsmuXdqvxuGiBPM2J4jDWvwUlzRAQ+cn35yolZ8N6P2x7ZwoUMU3rhiNz5AeNGRH0wvUZZlKDUQtmXMgAy8YEswD4vu2D6nmzs3hp/BxIM5Bx82AKaYqFd7rLu2tlF/KqWD8skoFsKDgWFjMUn5idEnx6msSbRg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TY0PR06MB5626.apcprd06.prod.outlook.com (2603:1096:400:31f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.36; Sun, 19 Mar 2023 07:51:45 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 07:51:45 +0000 To: Jaegeuk Kim , Chao Yu Date: Sun, 19 Mar 2023 15:51:30 +0800 Message-Id: <20230319075130.24962-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR02CA0074.apcprd02.prod.outlook.com (2603:1096:4:90::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5626:EE_ X-MS-Office365-Filtering-Correlation-Id: a36a097b-f488-46c7-f941-08db284ec8e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oRI9grBx3OlfcClQONykPGfF/kkEyaEQV095ERTsdlfdZ+VpJuRAAeWx71UfEyUfJsXIHz6YvLkgWNAqaRlgG2pbEsztNAuR6F27Ou1icS8khRlunsdufKe4Htau17xoVCuWZHi5w9pvANcLfu5lC52rg52AHK3OxbIe+ItlEf3mdMW59VTIaK0bWNT9FRiHdoZkW69BOEBAKovGD402JAvkeznIj76XG1boBvrE7YToLHs1f78WfJmAc5OglxL5KLbK26kvx084hMDM+QNcY6Ohk0XpsN4rxRpuUvDPH3oWrZmz2HoALvakJuSSVH2uNlLQcPrjCXhftkuNvet0nAY7VLidJC/1qhwPhn/ujUzSlhMtk8Ibar/NkE3IJk3j+aoWKSFC8LbV/lL7vko54jZIsLfbxICjjx0uZih9aHjJ031awCZ1nQUdE6rkBNiisrfv2nOSbN9keMAVPesZFsMAoZEEWlO2zoInD6fTc7v7SuQJsJYLLGasZ2IDMAQlqs5KSdOUMMSPIX0Tj5+mSYi7Y+VXE74vZUKOsH9THJTgKFPN2aDoRy4OFYCTFVEimQWmAAGXWnYLHeGILYmh6x1IK9sjdY7Zwk67SYL31VH84Dx6D6P7/ZegvKcijX7QKwkppBgU8QVJlKf1xxWe0b0YtOCnGIiv6c1FwccVSUi5B7c0l3VOLjprcwuz4kQLDwWdkiwVd5YrYiwRcKQ6Ig== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5269.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(396003)(136003)(39850400004)(346002)(366004)(451199018)(316002)(110136005)(66556008)(66946007)(66476007)(478600001)(4326008)(41300700001)(8936002)(5660300002)(8676002)(36756003)(86362001)(52116002)(6512007)(1076003)(6506007)(6486002)(186003)(26005)(6666004)(2616005)(2906002)(83380400001)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZbjM4SqKlKfA2PXX9Cd/4DxchugUhbsuRLWn2h9c7i32OlfsCiVR+gx80BZDMPYpvPAmt3d5VGpsguXhxFhAIxFXrYccdB+0miH18E/o9+AKWUPhTX09dWuH86/nt5m6yeDFSIPnCjrKm1qac+I6XAq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RNwTAI8o5tcSNLFvVPHgCU+aIdbBM/8nXmpyiwV9v0CtzNAGAFqFC5xP5CAGi8qyLjzB7rPB+2uP4c0mCkIsGHR+w5JL7axFIQhJBTZ5KIR32j54RhGE90ITBTTaoCvmkWOj8M3oN4hIFWGOyv1oe3J3He/8RStLrb4EX/ieBI+aK43+h8oibRPBhqwztITHsgHqgoyrnwgVm4a3oQOo2N5qpFR9DXBLqeoW5ms+/d9+jn4yEbQ48iZ6y28wlW5i39i99k0EG3nnGD1YXsuV/njGeUrwI72AJ8JYCpBAZ0RUfbFwFZU6Vohi6VV2y7eFaOX5Lnex518AeTYSodf+lMd2pNJpV3YpqZhx53FnkxhanuWQqGBp3fl8sfmIzYqFy6AI X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a36a097b-f488-46c7-f941-08db284ec8e7 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 07:51:44.8762 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FSRP7/uUvfg1JwTS0F8rZ8p+lPhZBZAkMFfc0ruvFX28gsjpGxyPN/qFF4TZbBy7helu6ABKXFdb9PCx9Evxtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5626 X-Headers-End: 1pdnpb-00DJkh-EC Subject: [f2fs-dev] [PATCH v2] f2fs: add compression feature check for all compress mount opt X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Yangtao Li via Linux-f2fs-devel From: Yangtao Li Reply-To: Yangtao Li Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Opt_compress_chksum, Opt_compress_mode and Opt_compress_cache lack the necessary check to see if the image supports compression, let's add it. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- v2: -drop f2fs_mount_opt_need_skip() fs/f2fs/super.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 9c87d91df61b..a88706bbfc0d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1179,9 +1179,17 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) kfree(name); break; case Opt_compress_chksum: + if (!f2fs_sb_has_compression(sbi)) { + f2fs_info(sbi, "Image doesn't support compression"); + break; + } F2FS_OPTION(sbi).compress_chksum = true; break; case Opt_compress_mode: + if (!f2fs_sb_has_compression(sbi)) { + f2fs_info(sbi, "Image doesn't support compression"); + break; + } name = match_strdup(&args[0]); if (!name) return -ENOMEM; @@ -1196,6 +1204,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) kfree(name); break; case Opt_compress_cache: + if (!f2fs_sb_has_compression(sbi)) { + f2fs_info(sbi, "Image doesn't support compression"); + break; + } set_opt(sbi, COMPRESS_CACHE); break; #else