Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1082074rwi; Wed, 26 Oct 2022 10:31:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TFYb6ZV/k9UfbSaE5qhNqZny394jdI9LaG3G8LUs/c7Iufc/u+Q/b8PBgZGK6+UVVcFL7 X-Received: by 2002:a17:90a:f0d1:b0:213:473e:6ff0 with SMTP id fa17-20020a17090af0d100b00213473e6ff0mr5280294pjb.87.1666805460860; Wed, 26 Oct 2022 10:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666805460; cv=none; d=google.com; s=arc-20160816; b=DAfAYfYW/xiNeXiOSK0MuN0eIh8yqvFDe7SPMsJAt4cpjdNfEgj1sq8Bx2aU37GzRv NYHjbBB5uwFlb9lGezNh5aVwlZqd4jTMPNrLwPE0aWk/l+IPSy+3xLE/w08wOUhGCDtW mqOdvUgyR4j9VY9ogbF8kdvDPBhvPNuMgX7xrrNx/0+YMJyBVHodU17uLWWi1C+I844Y kFtkoqOlWjSmIz84xhOv9AwAZt88I6/d2ZFpcNePqBWRXicHE0l46yNy+yXKhjE2M+rZ Y+HPj37c3ZjvKcXclS30fgqRenOogBnrMt6k9EtCs9dsL5mJS15NHBIGUTy6jquoWIyo rV2Q== 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=zxmpHRfDFHUhiMRwHCT097VDEX9SLvjDK4DVttdFLvM=; b=i8kdH5d+Xbzok3sD9ga7/VaNFDgibZNMk6ucOr0E8dySGZs71f8JZZbR36H8N5trE8 N5+/zZLPUWWk7jE0GrJTwD3FmKzyOVlsl2R1DENRVPQsvUGif/4Q8+bPDkLFo3I/KGAt XXDRljZBjAcikphnZNiW/IP/RbisTsvzh7d0Ckn8XgrKnGD2/OgdrHwQjWN6b1tEq6ZQ rRaTw+QkuwlWBZtSCZXR23/q6zBAro8sraprwl7p5DxvYPlNrRHJcEagNvgxri6lEy/i iPGl1wDhCoVVfT8xm8nqAb4cPI8g0hc3Bnr/5ttoW3dOms2C//BD1mUTR2232Taaw8+d 1PDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rCieFf8W; 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 v16-20020a634810000000b0046ed15a820esi7361058pga.385.2022.10.26.10.30.48; Wed, 26 Oct 2022 10:31:00 -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=rCieFf8W; 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 S234098AbiJZRFE (ORCPT + 99 others); Wed, 26 Oct 2022 13:05:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233893AbiJZRFB (ORCPT ); Wed, 26 Oct 2022 13:05:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7968317CE for ; Wed, 26 Oct 2022 10:04:58 -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 92D2CB82373 for ; Wed, 26 Oct 2022 17:04:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30064C433D6; Wed, 26 Oct 2022 17:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666803896; bh=Q8RhGmve0EqK5guDgkRGYNKHoxwkXq/IG+Ua0iv00Ik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rCieFf8WqL2FpAcgU+cOs2w22J1Y6niUHB/uor+xLGDg/Mv/XH/ITS864Z9S8pEQv +Wkrt4CQsoKa+AAENjkfcOn4tIvDR73oyBgxUt55EZ6u0fvXko1Ls22bBspx62KBj/ wFlWgKu2oF5k04p4+QHTSAXetBfsErFAXpAQGXcjESpgFO7b5PUJT1H12hk2YYk6GH /XEuJKVjDmeJHRgP6IHVT1Es3picTCllSIcpDo31ZKSrjCqiEQKh8THaDm1qNtFwKV Qj4edN7/N+rxE5qx3bt4rQ4b+0drMyjOVATc/dD7CzIhkAIkK1NVpVEXMXvnH3yAyM eUJuKBvbll06A== Date: Wed, 26 Oct 2022 10:04:54 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: allow to set compression for inlined file Message-ID: References: <20221024233634.803695-1-jaegeuk@kernel.org> <0a339e33-d79a-19e4-fadd-bb37a5a9f79d@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a339e33-d79a-19e4-fadd-bb37a5a9f79d@kernel.org> X-Spam-Status: No, score=-7.6 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 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 10/26, Chao Yu wrote: > On 2022/10/26 1:46, Jaegeuk Kim wrote: > > On 10/25, Chao Yu wrote: > > > On 2022/10/25 7:36, Jaegeuk Kim wrote: > > > > The below commit disallows to set compression on empty created file which > > > > has a inline_data. Let's fix it. > > > > > > > > Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed inode conversion") > > > > Signed-off-by: Jaegeuk Kim > > > > --- > > > > fs/f2fs/file.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > > > > index 1c4004c9245f..304fe08edc61 100644 > > > > --- a/fs/f2fs/file.c > > > > +++ b/fs/f2fs/file.c > > > > @@ -1915,6 +1915,9 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) > > > > if (!f2fs_disable_compressed_file(inode)) > > > > return -EINVAL; > > > > } else { > > > > + /* try to convert inline_data to support compression */ > > > > + f2fs_convert_inline_inode(inode); > > > > > > It needs to check return value of f2fs_convert_inline_inode()? > > > > I intended to catch that in the below checks? > > But it may hide the real error number, e.g. -ENOMEM returned from > f2fs_convert_inline_inode()? Fair enough. Let me send v2. > > Thanks, > > > > > > > > > Thanks, > > > > > > > + > > > > if (!f2fs_may_compress(inode)) > > > > return -EINVAL; > > > > if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))