Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9317583rwi; Tue, 25 Oct 2022 18:34:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Anl5YG5sdf2pMBcynWlHAJP0tIPBlMKN5xGIrFRthFGxUvKaUuvk79n5HW98yKTJTCywk X-Received: by 2002:a05:6a00:1a8e:b0:565:b185:cc10 with SMTP id e14-20020a056a001a8e00b00565b185cc10mr1684298pfv.71.1666748058125; Tue, 25 Oct 2022 18:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666748058; cv=none; d=google.com; s=arc-20160816; b=iJs1bsobQfjHFJI15nCWY4t+k+/nHUzIjMiO5N3WhRbLoML8F20kxUx6k8ou74vp6o LE3htJoyOcKSbd7sJNs4B0Q9mqL1PSGqSIELfg1O+J0XwrgFZ4k46CCVPDpItZaBdTK1 3H1ubMw97Ac81L8xsrjS8kZMdGtNHvp39Nz6y4VXZlHW8SnQI9nYvfz/BBDB7mIx12Jy HpDbXUC96iZKcXTI1UOV/BqZX1xIvYnQeEEbjTNuOmwDs51HEu8AUcrARq031QWXjEP5 mqG5i10LotXJz0ibg1T5hG5ZcDYLqKxohygCdo53LNxx1SNxEz+uPTIQjgzKlQqFn+8r bldg== 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=eafPppTfAIvC5huZTEwOM4KBYi0IRA129kyNSf5kBYQ=; b=DYSWvwtKudQE0xIzluy3OyvAuM5sk02UO595gTaiVr7ruwSATVRoIyMeFPoEEGwKnM SDxDV4/bj/gOSpYgt81HpiGLorT1zOcVBi5FKf6/60qO54jvYqY0jRz8JvOUUmEYKgrG XJH3+AmZKE4nON4WW2/wBemvgsCS3wHsJT9CC91KxiMYTH2cT+aLk5GjlNx/E+nHNeeU dr0aeINtPhrFQ720NUdm7XddcwdOet571nUrPGd4Wpx3lmO2TvC7KK0KW014/It8jJsV wwAVbJTgDHYB02SyfdquZJeaIsUPZ6eVjh6XIZzITerGr275tCIrKeAAnvq1Owt6H5lf l0hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KjxblEtY; 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 b24-20020a630c18000000b0046b3ba2c806si5048685pgl.145.2022.10.25.18.34.05; Tue, 25 Oct 2022 18:34:18 -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=KjxblEtY; 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 S231449AbiJZBRz (ORCPT + 99 others); Tue, 25 Oct 2022 21:17:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiJZBRx (ORCPT ); Tue, 25 Oct 2022 21:17:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80206C2CAA for ; Tue, 25 Oct 2022 18:17:51 -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 1431461C4B for ; Wed, 26 Oct 2022 01:17:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A9E6C433D6; Wed, 26 Oct 2022 01:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666747070; bh=wOZM+oyBXIQ35iD4e8i/HPoDGliVpVT3G5QL4pHtCHI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KjxblEtYkDKjNwJ8VsL3Wu5qqrR3r+cRA9AzCCnoW3NbrHdnpv5DGQqiCcgh4HWta rX/qtOzJdSP5T8KFE3FbK6jVPC5lMmYtfK3XNu7YkUoIIikTH8ev57C+I0PH2BXiga Ypoq1mW1gveyQRLnXTh3qUhWcGk+9i502SWYaFVaujfYzXaC3f3A2aI2v6Rp2pCCDg XbupuPLwPdNtb0iiErCG8dwS7AC9a9tfYeCLcF/itpN1esqgQO4wSTqhQMfJcgSnJ4 1kXf3t5QuIjvzmKGja2lvVs7mIPxp/hdIKSM+TrMHIffaBUSELFLQAgFyRvGsDiM+A 6Ea5ObtPK4WHQ== Message-ID: <0a339e33-d79a-19e4-fadd-bb37a5a9f79d@kernel.org> Date: Wed, 26 Oct 2022 09:17:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [f2fs-dev] [PATCH] f2fs: allow to set compression for inlined file Content-Language: en-US To: Jaegeuk Kim Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20221024233634.803695-1-jaegeuk@kernel.org> 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.6 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 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/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()? Thanks, > >> >> Thanks, >> >>> + >>> if (!f2fs_may_compress(inode)) >>> return -EINVAL; >>> if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))