Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3890839imw; Mon, 11 Jul 2022 18:57:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sKHs+qs2OkIi9Zbx2on0RjU+4+yg1gHOaYv0Mt3NqXZ1Z3JOC00j+gCtlvWLu94toZbk7j X-Received: by 2002:a05:6402:280b:b0:437:9efc:a065 with SMTP id h11-20020a056402280b00b004379efca065mr28809613ede.3.1657591034272; Mon, 11 Jul 2022 18:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657591034; cv=none; d=google.com; s=arc-20160816; b=lP1RvWeUrifX+oeSiGTVqFI50BxU5xphwrQWuk26sFWsdJpZufOSdPusHSPUy86NJF TOLW9Y95Qt7bvu0wdlcD+Ysk7s7x4SVYPMBEWCB4JzRaB4d9b86nJZgvNnAyqwggDNtO A6xE4qClcL1XRAWK5d0jFqvDgvjlaUNarmS5T8dY2HIEyRkP8quMxgBt2u4/s9sxV+Gp d1rUnzMDyS1vd1n1bWhVNkmjGSrVxolvZePPeyhMC/Qid8jwYzlPA35pvGDA2xSU0nYl i/6Scw8htP/7n0JySv63cMtLhqqDXql0Qap7GcqId0yGZDq/tLPdhfSGzNkSLEsJ8nNe 6m3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=92ygucdnz9/RyodLaIdgfSjWVyWnDI5/VqYIKiPR9cQ=; b=mIZEqpBdPo3+ZKOlmrhpDVaSmmJFdjww1q5BqUjBKh2u3lmBMiK2X9ZV3vTHw/wVlS QLAlNet9jKkO2+v5V/chRZxUVqODHo6dypXaC1R8m9bJnT4Y5/e8GZPWpQFvbsEUVBp7 ftRGioeqTuzimEa0QTs/+qnPZo8mEmkRlSs5kJm3qSiacZwBQMSVD7ds5mDrU5LvEMzN IhKBC/bPAejrJjwe9VZehF+kjbcmb7+Wdk/ltti79kJWowzx5T/E3fl/pIrQVpyhVuyr nHyDu+9Xo9NgaPvROCxUPSNbaj4sMGjja3QAgsNh1BnAs2W88uMP5+gfCRsJ87Bvz//X wkfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qaDgs4VD; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a056402075500b0043aa028bc49si11105553edy.154.2022.07.11.18.56.50; Mon, 11 Jul 2022 18:57:14 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=qaDgs4VD; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbiGLBgU (ORCPT + 99 others); Mon, 11 Jul 2022 21:36:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiGLBgT (ORCPT ); Mon, 11 Jul 2022 21:36:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D542B1A5 for ; Mon, 11 Jul 2022 18:36:18 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id D247C61653 for ; Tue, 12 Jul 2022 01:36:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8663C3411C; Tue, 12 Jul 2022 01:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657589777; bh=abHCq8B2o5LmiSh6NVX2ViHoKDAMvedKljs2uYyePag=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qaDgs4VDWLWaO2CeuIz4TzgPD6Da8R8RL1qnYqUcmYK3NFlvaiUgw7aD83/CeAebW ZhQUavLZzC4w8UC7VmZ/trapbEmsdEc0vQoOPLnKPWdOPSN6LJ9R5vsnUIViIoItED uv3lSDL8gEv7d9eAaz2wbZfToTVVkfc1svdtnr5DlQa2KdRf4omCDl4OMMAfkhsIm+ QKBlbhGwxpLj/+b9hoMqVm4VdTXgwoqXWC8VHI8zh02WYOBTp7tsskeuxuJR50ISP4 ZFE1A3eTxBhhD+q6gYa1zHM03J+tD7SS0Px2M3DUMs82iTdDPwOyIuSVw4hs7C6Amf M7A3i/8ZvkUig== Date: Mon, 11 Jul 2022 18:36:15 -0700 From: Jaegeuk Kim To: Chao Liu Cc: Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yue Hu , Wayne Zhang , Chao Liu Subject: Re: [PATCH v2] f2fs: allow compression of files without blocks Message-ID: References: <20220707090924.4183376-1-chaoliu719@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220707090924.4183376-1-chaoliu719@gmail.com> X-Spam-Status: No, score=-7.7 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 On 07/07, Chao Liu wrote: > From: Chao Liu > > Files created by truncate(1) have a size but no blocks, so > they can be allowed to enable compression. > > Signed-off-by: Chao Liu > --- > v2: > - update commit message: truncate -> truncate(1) > > 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 0f29af7876a6..f7a82858486a 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) > if (iflags & F2FS_COMPR_FL) { > if (!f2fs_may_compress(inode)) > return -EINVAL; > - if (S_ISREG(inode->i_mode) && inode->i_size) > + if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode)) What about inline_data case? > return -EINVAL; > > set_compress_context(inode); > -- > 2.36.1