From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42738C38A2D for ; Wed, 26 Oct 2022 17:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234124AbiJZRFF (ORCPT ); Wed, 26 Oct 2022 13:05:05 -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> 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))