Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3940144imw; Mon, 11 Jul 2022 20:33:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tQaXf6UyPh1GIGlOkkfS4MRREgntaUO4ztGmRf8fv2VtmvjNJhzvPRpPXOQRYY5wRiszhx X-Received: by 2002:a05:6402:150:b0:437:b93c:3a9 with SMTP id s16-20020a056402015000b00437b93c03a9mr27885752edu.82.1657596805350; Mon, 11 Jul 2022 20:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657596805; cv=none; d=google.com; s=arc-20160816; b=p2pmWEI8Ps21ELvC5C0l/MG6SkMbcnhW+v6prsKhxkSKSTOBVnjOVvk97G9Y/2TrS1 XU3kXz+1uWgaRLAzLyk4FcoISr9zAvIinJ32YBOupDcJKgCPs00pgr05JqQo4MSWKFtM wTVxaFghb/xcoFv26CjxvS0QpaD8BSCWbLnrBGzPuYNL9/dBLBEAD+n9zpok8yQlF+q2 iu8KNIOvJxAd+XbJrjPEQGou+TT+fHQp0+upoQ3cSL5VSnNwLeYr22KOa6TXTC584F0J AYDzudCTRuoaIgEQy81cJfKCNm4qt9SDj3g6zOp9e3U1NC4tc1j4gO9VDiaSr3NRStUO ukSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=szZNUoya9hyOeVlpTYk21XTf4glzGR2vjRotlPdnfc4=; b=kKXZ5NQeF63X4HwEdGv1gfA7rADUzA9MAboyxalH2FUL2Q7u7VSBZyKm2eSlkBec1S mHTqhzQSmgir88BR7kUh69PgCMXpH8ggtv8QqfUSxTooKphPT4HiFiLu4sQyqH5B0pdw LAKywhUdM14SqLmoeBJBh4XKlZ0dKJLOa5Evrk9PWwicfGVSdewpem/7iUTeHOdFX+nr 9dJCZATi3ylMa5PV/6PgCzjb9YowHwqyLVIhqLzVMmLnhcHlaObf62cu7k2xAb9/ak/U Y/5zks6Rx5JTCUDycQgv0fAv7MDzg4iI/eVWAb1yZLTXxxsN77wnEIBvjCPiD4ldYDEx K/wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nNmF6prI; 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 g19-20020a170906c19300b0071224cd611fsi11032113ejz.910.2022.07.11.20.33.00; Mon, 11 Jul 2022 20:33:25 -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=nNmF6prI; 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 S231259AbiGLDUb (ORCPT + 99 others); Mon, 11 Jul 2022 23:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiGLDUa (ORCPT ); Mon, 11 Jul 2022 23:20:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C622FFCF for ; Mon, 11 Jul 2022 20:20:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id 04287B81648 for ; Tue, 12 Jul 2022 03:20:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B198DC34115; Tue, 12 Jul 2022 03:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657596026; bh=A94ul8mweh+4BJqDHv4Og+e7RYGSYz/Z21kD0JyUEWw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nNmF6prIjjCZkD+2RNfpv8Yve7XSQpXtIIZSBU1U7YIfd0bS7Fz8ePIKCDYZ7Cjv+ IJapziuZ6Ensnhb1o0QfsVie+XhXgFx1bOzaz0oHt3Kz68rl9PKEydYp9MSh9UmGQL j4Q939pbwRPP0V59MjH5xlrl8kBmQHeHjg6CMKSniqeYTT7Q9FL9fQsXa0yjndBpLo 7Lm7xMDO+o+qipcj1lO28+PvLdHmTALBG2TzXHa2DHUWAQJ508uhmhSTqqmvl1WARl 6vqaUfoJhikZaC7YXR5O2raNrw8eEIGKNV6jKSv9qmw5W5mHWD3L9xqCctSBEQbBj8 vv5ag2UHBPp/w== Message-ID: <3ee4ce0d-2f50-ca7d-14a9-2368b9db7d13@kernel.org> Date: Tue, 12 Jul 2022 11:20:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2] f2fs: allow compression of files without blocks Content-Language: en-US To: Jaegeuk Kim , Chao Liu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yue Hu , Wayne Zhang , Chao Liu References: <20220707090924.4183376-1-chaoliu719@gmail.com> From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A, 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 2022/7/12 9:36, Jaegeuk Kim wrote: > 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? How about fixing this w/ a separated patch? f2fs: fix to check inline_data during compressed inode conversion Thanks, > >> return -EINVAL; >> >> set_compress_context(inode); >> -- >> 2.36.1