From patchwork Mon Jan 23 09:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 47077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1517425wrn; Mon, 23 Jan 2023 01:49:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXutVjxSNCg/JrqVayqEQP4oK2XYFpECyx1tAcEp3X0G5651/sCmncehF0/hyROluEANYL7e X-Received: by 2002:a17:906:fcb3:b0:86f:8ccb:5d0a with SMTP id qw19-20020a170906fcb300b0086f8ccb5d0amr24915566ejb.36.1674467395858; Mon, 23 Jan 2023 01:49:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674467395; cv=pass; d=google.com; s=arc-20160816; b=mCne7Kilskwp1LOX1dA84svNSo9FEV1fnXoVE2rgC0cDI7Ov5aLnFb15PAjo2JAgKa ZedJTNxK3tlYwIeK+WD1lQ7McoGy7sYTcXKNqa8AFUVivvqrAiy2IoTFNdbeqcG4UIkf q5eYsirdWRPqIh86tMAjgw6cFjsVPlWZmIEcDKK2Eb/4jL2cI1tRmVhAN0THCog21uGe Symsfp8nR8Bb447jUbXYpzw14+j3uXWm5Y6Br8ARFdoRgxLiB29+cu9HTOb/v95xASQw rd+Q64jeEnLeDxuagqrHL7tb3Hx5Rceg3oORcjHyZJ8L7bRh1jv/lihdcGhMIThsQzGg U1HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=EeTah9Sh4ca1NmIFs74cPy3SvfbejDbxJ/JZJfTsga4=; b=NhL61QyTnoUXhgYb9rC5KlG2HKEMU7cTHsDLc/rtzHn4OdCDsIobz38otG3lgYcUvC 4wCSLWod9foaqPRf+BJ/3IGfe54GQl5n/IwsNx2vjyXsXvzX2fAFE4ALfaxFLCJ4Wqo1 GOoQpOxBuCcrIvZY/7ImydLPfifVP6ir7i54xXAcSgwWvMreDXnqhxFEDejLHd4/Jz01 HhMCNETfWfPpI2f7C01rx7n+djE6mbRbqKwLsdhmXgz1X3qmxCVQr9ZiXh0O2ItX+Kpx ApZmsplGlHJ0TMlwhBFObYoYhjZITjcP0YM7plp4WfUsNi3G1dDzUgp+EITCmCDJR2oB haLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=RWbGQ1l9; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt14-20020a170907728e00b008318885e1f1si56903608ejc.176.2023.01.23.01.49.29; Mon, 23 Jan 2023 01:49:55 -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=@vivo.com header.s=selector2 header.b=RWbGQ1l9; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231599AbjAWJqU (ORCPT + 99 others); Mon, 23 Jan 2023 04:46:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbjAWJqS (ORCPT ); Mon, 23 Jan 2023 04:46:18 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2110.outbound.protection.outlook.com [40.107.215.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520C51B547 for ; Mon, 23 Jan 2023 01:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=icAkN1A2iehOyCBi2478pQ+nhI/AurcC8POZ7Le4KdH6xWeIiS3bqbN3I9II8k8uoGsABOQ5mIDFN3nRZmgMnJ2TQfVHEwIRZLceyuid02AthJrhTZXbtC/XpXksEReJuBqjkgbK6LpoRLuiVdn47E5xHbt0XsYbcikzAz1FBY7sVJPa3y67wsjNeeVC1qU+XGaGiAolYvbRx8PfwHlbYACyqle7sewjWhT2GzXdQJlO6hPFr6a8WueFCAtaVs4iuv18NlTCsIZGh/4vHF7OSyaP6nWYHMg7RZi3HfADZ3yo5l0EqIJIe3Ho6VMg2jcoDBA7KToX9OpiMKAVnqluFA== 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=EeTah9Sh4ca1NmIFs74cPy3SvfbejDbxJ/JZJfTsga4=; b=dVXRSyoTlImG3ZkuTiQUdKPJ8S0oBbFqc3QK/sFpHJsKNubIEFvuUc2AyYCJpH3tV5596kARGwzbUtSInm2pZJtaoJBAVeyxMH0RTQ0nAGXKQCXpepLqB65DZngX5SlIinzjTXDqHHI3478pDBTLEOJizyFMoudzxAe5ZPg2xu4kY1IB7nz+WidgDDB6mVRpQjV5/URvxZOlKM0aaxXjjaI876qcGF8pnxh351rWb6LOBozPWY14obsMZcigpUfxn9BUAHNsFZta3lM74bI6V9NEFOfyJXrznuqWHrW4w6Ng81jUNHsrPrY8KEYCEQdOu95sXsTyVeHmSG1POdKaGQ== 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=EeTah9Sh4ca1NmIFs74cPy3SvfbejDbxJ/JZJfTsga4=; b=RWbGQ1l95ykdyR8V4woWA/binlDqcjU00dbBgck+ap+jeRNog8VkbRq6eaItAUlDV/ewZNqP9+QvtV3Fqj/5a8v/tH+ItGQ1sebKVnCy346tPiHBc9jnnX+ccobS153ztwhclR4xq7YsHDqgkXlwtcTRgFhMmCBvC0GOXYBVmUtEYjLIdAVr9vpVr8y7fOEHgFhuCji6wJUVLwKAR0LGNswQgRk7X7M9FseB7fspEFdL5+Bvmyz+VjEHdBza/0gRtRbRXUvEvL8LME4wxMCOgfm64kVB9VfG3G8Gt/HJlq59qgCgiaXBxGV3CznX5In7PcQXUgv/7binY8sBSltulA== 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 TYZPR06MB6113.apcprd06.prod.outlook.com (2603:1096:400:335::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.14; Mon, 23 Jan 2023 09:46:13 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%4]) with mapi id 15.20.6043.016; Mon, 23 Jan 2023 09:46:12 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] f2fs: allow set compression option of files without blocks Date: Mon, 23 Jan 2023 17:46:01 +0800 Message-Id: <20230123094601.32940-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6113:EE_ X-MS-Office365-Filtering-Correlation-Id: dd66e5a6-2872-4427-682d-08dafd26a96e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rX3mVstUKBsCw3FnUd3EbpPGDbcUk70XR9ZgKSTkY6AW/mdhVfzQ4DihpTA7Zh+3vTMsBAtg1Y3qUgvbCuUwZbC0Qmo0RCdQeu4hyYUiTjm87c1h5DkWgL731aFx1qifBtTl3w7QZAlu1iEPkAyf9U+FPHq8amgyDCTci1cv+gHMLEuNeQelHvYM3AvePeBGXKtrE9NexbwO4/GCmf8EBDgwQiUFWa3FTAIU0IFxZWGkJPwV1NeQQ2bDfggUrWDIWRFt4AFWUlfrf8Zv9frHaAT4fJ34aS85sixRdxelSL4tqpxJwp6nr+MJ36JGNCIgeEaRh23UDO/nRQ9fYej2J+/i44YGJetfvQkQyFt1DTN4iU4emPigcjcWdGW3NwpH5U02YXZDzhWdilqSahSo2oJbTASSkpuKWV6dlDglcs3k892n0t4ei8m6TLpsx0BAR9CJ4XllPOLg0amJmHCV4+xsFxefUuEem3nFiNT3fXEBO4gyBay49zbOa7yXmjKZZNw5zIhrM1gUBeXjDKq/ya9CNgjt07xHl6/SqW1MbPw/VoQwVFR+0MuuLJNsxa7VwWLpOLSFR2RtCIOF0EHXvnhbOFJ7GwW+hJ874uDKAa2EGLHfNyOj4YjIetVJwWjb74OhrkZYdxjeOmyarCIs/AwqjhVU5Dt9wWWU4jfAJfBkWQvWtF1CrNAe/k/kjuVV 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:(13230022)(4636009)(366004)(346002)(396003)(39850400004)(136003)(376002)(451199015)(36756003)(2906002)(5660300002)(38100700002)(38350700002)(8936002)(4326008)(4744005)(41300700001)(83380400001)(86362001)(478600001)(6486002)(52116002)(66476007)(8676002)(6512007)(26005)(186003)(6506007)(316002)(2616005)(66946007)(107886003)(1076003)(6666004)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a+Df6vxTxX5QEb7EV6RzGb1K1F12rPvPZ29N9FGOZkfFmkLjN4yfvFMfTbgDwBEJlzwfgYDzG/ZjBLbouLsQLisnlFqao1hpA4HWDpLLe6boH31ub8As/1s8QDbf50w1rKdNtdYQ/XgMZFV0XsiH0yTyYZIng8Wz6MpDg596qtk+ql+PUQOsccoBC6rFQ278Uwl6aaAA9COjK4XXKs2oAanp/6i73x4yHcOPxzunWKxcTUfO2Ii0gf8tLEX2ArasDZDOx4LgPpM0+e76/InUDHwihGrBqe/2cZxYAO8QOz4AE8mgAcJCyT4n/dFf2GOEqL8jDJXmBLZlB5MvevctwxXL89M8GNskXj2V8xROpwsGkBcZMuJIotF4M94wFn8Agv17VFzfb3cdIEYJnc4yfkS3Za/mgDynBnRg+FA/m4c5XqDYL7i3Dm1hI/0NfxJqB0Qa1Ahe8sBLx7gny3pc5QZSk6vkmefk0tzFrA/tDYkF6NNZOq+bP7YzCiKSuwbep36NuyrMyw3TiRKx6+8+SFgywV18XBLFuAvXLh/82J/rkJpz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id: dd66e5a6-2872-4427-682d-08dafd26a96e X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2023 09:46:12.2171 (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: 3u9YkSieTPgzpjqhBTivHb9pnWbT2NoNfeyMikPv0QeeTZ6KLlFGRsh9nzRK8BveD0aak8iJPqxyJoexX+SGeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6113 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755806324124568527?= X-GMAIL-MSGID: =?utf-8?q?1755806324124568527?= Files created by truncate have a size but no blocks, so they can be allowed to set compression option. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index b3bcb50490bd..fda04c37b48c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3990,7 +3990,7 @@ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg, goto out; } - if (inode->i_size != 0) { + if (F2FS_HAS_BLOCKS(inode)) { ret = -EFBIG; goto out; }