Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8847315rwi; Tue, 25 Oct 2022 11:34:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kAkvoXNL8e0nsCl+1ZWrltBqVJ4NHN8ikY0guvNzOY8qvLoBJ4fGWw549v8k1xjLZ6UK7 X-Received: by 2002:a05:6402:5ca:b0:43b:6e01:482c with SMTP id n10-20020a05640205ca00b0043b6e01482cmr37778777edx.189.1666722854358; Tue, 25 Oct 2022 11:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666722854; cv=none; d=google.com; s=arc-20160816; b=JBgPzDGF2YBpUoLeytPZ2XKfBljmKDHgHpIu0rqOPVq/YoP0a6kSS2v6+X6ncCzhi2 P1xvrOrrzrWa5AqL6f7UW/gn5EuevsWdxOoIhAoIXTEOK05NqWXq/H0AQBV/9We+A/OE MFb4dPpaPeLWGo7onJce6NmH6Tlz5PgLB6hhMT8U9WSzVHrQK6/tTUiwlgwFEZzRKrKc j7jYUjmqDBJY4mGSktd4slQ9rBuho/nlSk8O21wOdO9+OefHe9jEjUwkPA2EpShwjg6b hs50hN4rSaNqSaJ2DLlOY2ir/UqecAqh/qtXnsU+UHAP4RLvxIg+4ywIya3WWhP3M/7k LMdg== 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=YqZ/JWK2mfhFRti/cu6NxBi7QgBjQWgS32RhW0qhANw=; b=HybBsKu6dtDWjpUAsZ6N6DDb/d4HxvpS/P6Ciw4Ftaw68rkUESs5wNVMUA6CnhyL2u qmc3c3Qfuuf3sTxWmcZHnjWYc6TZD4wQVUVjIpd7D0Hu0UfGbqCRDmGsH+ZZFwmjImfG s0q4osLN+IKEgIP6coGhFXS9ZkEiXilmFNT6ve5Vr+fBkllHGu8Sd5gZJm8zvWs4bglQ +sSAHHbOe2eW1hXSvFx7GeEKW/R5PYcIGSyloWNSvLMFMJDgaUxui51ie/txRwyA1DiG gW5QSz37NmT2bDyhY7D45WQfxL94yyPtBtiTU/u4LJ0f382DOktxwoZf2ya7V1RePs5T 6+zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vz3szJxF; 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 l17-20020a170906795100b00797670441desi3700694ejo.911.2022.10.25.11.33.48; Tue, 25 Oct 2022 11:34: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=Vz3szJxF; 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 S231748AbiJYRqW (ORCPT + 99 others); Tue, 25 Oct 2022 13:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231378AbiJYRqT (ORCPT ); Tue, 25 Oct 2022 13:46: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 01A7A1D0FB for ; Tue, 25 Oct 2022 10:46:19 -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 911FD61A6A for ; Tue, 25 Oct 2022 17:46:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D26C8C433D6; Tue, 25 Oct 2022 17:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666719978; bh=8BegBzFebokZgfEsi+2gc5z3pDHvlffY3pA7fRmvbaE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vz3szJxFUoMewNmxuZdYMbx4vxSeB2p1KITG6qDCF85pVelpc9IE+Oph1RmSuLhf0 f72zpbNOOmAVDBGs7OLaq+/ta2yv38JLc+OTuwAgp+ozh+EKEOQSIpUfCIwBLczYkE NHuW4etuUZtYatuJrxaRN9T87BZAeQM7KwDpmytnxCpwMx69Y6xK/mmgukqVwtSYD5 FFCVol+3F3ELM3awyn37iUlJi/LWZ0wU4roVk7JqfM+DpUYr6GDKxoLVG2NOxdfyv1 x3VmrXAajNhKVZVt4kMBHtOE9l8KwSGQYwMYQBYjKjboLQX8Lvm9A/5fhCllG5tQH0 VG1nBLvtYT0Xg== Date: Tue, 25 Oct 2022 10:46:16 -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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/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? > > Thanks, > > > + > > if (!f2fs_may_compress(inode)) > > return -EINVAL; > > if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))