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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AC2AC433F5 for ; Wed, 27 Oct 2021 04:26:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32EF3610A5 for ; Wed, 27 Oct 2021 04:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232618AbhJ0E2a (ORCPT ); Wed, 27 Oct 2021 00:28:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:58330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbhJ0E23 (ORCPT ); Wed, 27 Oct 2021 00:28:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D4636109E; Wed, 27 Oct 2021 04:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635308764; bh=W6FMTI2VwUiwDEPf2lg4qjV7hDXEBWma0uo+TjtD/TA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ju+eaB8MDCIW6dFF1lewvAl3MLkwdYqpsQToGXqAoce7iU4OJlTxXse8Cw7CvLS0O s1eByC/ap9dH5t2H4brMhk+GqaSwB/tnVzRHV3hPnBiHHrJ4MYx7naQpvWzG2qCSOv vvCzHPCGySXaNMXqWitPZ5bTsI9Au/PeiSJhSN6Guzb9UGSoRaAUU9UcSdHFQR+5gj 9TP2dp9s5K+6OcxdSsFtp1ks9sZlFDnvUaE5cBQQfEUqjLPwcAhUA8uHCKFq56mm6B /Pouo/edi8ZIVnXL936pQi6ZRPscD+65DS2MrsPzWHHZaBI6Sc53uDQrqx+YlXhLbq aZk+fgQVRLtpQ== Message-ID: <3be80c98-f637-c5a5-929f-1ddc1994c7bc@kernel.org> Date: Wed, 27 Oct 2021 12:26:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [PATCH v2] f2fs: compress: disallow disabling compress on non-empty compressed file Content-Language: en-US To: Hyeong-Jun Kim , Jaegeuk Kim Cc: Sungjong Seo , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20211027041600.115847-1-hj514.kim@samsung.com> From: Chao Yu In-Reply-To: <20211027041600.115847-1-hj514.kim@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/10/27 12:16, Hyeong-Jun Kim wrote: > Compresse file and normal file has differ in i_addr addressing, > specifically addrs per inode/block. So, we will face data loss, if we > disable the compression flag on non-empty files. Therefore we should > disallow not only enabling but disabling the compression flag on > non-empty files. > > --- > v2: > - check F2FS_HAS_BLOCKS() instead of i_size > > Fixes: 4c8ff7095bef ("f2fs: support data compression") > Signed-off-by: Sungjong Seo > Signed-off-by: Hyeong-Jun Kim Reviewed-by: Chao Yu Thanks,