From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754712AbbCRBMv (ORCPT ); Tue, 17 Mar 2015 21:12:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:24285 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbbCRBMt (ORCPT ); Tue, 17 Mar 2015 21:12:49 -0400 X-AuditID: cbfee61b-f79d76d0000024d6-be-5508d10f605a From: Chao Yu To: "'Jaegeuk Kim'" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1426611461-690-1-git-send-email-jaegeuk@kernel.org> <1426611461-690-4-git-send-email-jaegeuk@kernel.org> In-reply-to: <1426611461-690-4-git-send-email-jaegeuk@kernel.org> Subject: RE: [f2fs-dev] [PATCH 4/4] f2fs: avoid wrong f2fs_bug_on when truncating inline_data Date: Wed, 18 Mar 2015 09:12:00 +0800 Message-id: <006d01d06118$a3a23390$eae69ab0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQK9rNlQuRPr0w+J/uCqCDMOStWF9wGmgiE4mzmguWA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t9jAV2BixyhBvO4LJ6sn8VscWmRu8We vSdZLC7vmsPmwOKxaVUnm8fuBZ+ZPD5vkgtgjuKySUnNySxLLdK3S+DKuPnRuWCzcMXpn71M DYw3+bsYOTkkBEwkNl9axgJhi0lcuLeerYuRi0NIYBGjxIs3b1ggnB9AzpyVTCBVbAIqEss7 /oPZIgJqEr37poDZzAKZEhP6X7CD2EIC5RLNza+BbA4OTgFHibtz80DCwgLxEnN/vQQrZxFQ lVgw9RIjiM0rYClx5cgGJghbUOLH5HssECO1JDZva2KFsOUlNq95ywxxqILEjrOvGSFOsJJ4 2NnKBlEjLrHxyC2WCYxCs5CMmoVk1Cwko2YhaVnAyLKKUTS1ILmgOCk910ivODG3uDQvXS85 P3cTIzjon0nvYFzVYHGIUYCDUYmHtyGPPVSINbGsuDL3EKMEB7OSCK9WC0eoEG9KYmVValF+ fFFpTmrxIUZpDhYlcV4l+7YQIYH0xJLU7NTUgtQimCwTB6dUAyOfyx5tLrc4v/hd+lL5/tnu 2ZzfpO8Hin876W+f4+CpcPZB5k8HZ2fubq3YGbWf4y1CdadxnLI2U2/cH7j/0b6tm/j+7LQS v9r8wbz17e9bhlvfNbxInm6X+ayvKo+dibWin7Po4HbmkrzFmX4J53vq/0v9a2M3mWB7ysqz mI1/29EW/pkzlViKMxINtZiLihMBmRfGY3YCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Wednesday, March 18, 2015 12:58 AM > To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; > linux-f2fs-devel@lists.sourceforge.net > Cc: Jaegeuk Kim > Subject: [f2fs-dev] [PATCH 4/4] f2fs: avoid wrong f2fs_bug_on when truncating inline_data > > This patch removes wrong f2fs_bug_on in truncate_inline_inode. > > When there is no space, it can happen a corner case where i_isze is over > MAX_INLINE_SIZE while its inode is still inline_data. > > The scenario is > 1. write small data into file #A. > 2. fill the whole partition to 100%. > 3. truncate 4096 on file #A. If we truncate size over MAX_INLINE_DATA, we will convert inline data in f2fs_truncate rather than write_begin below. isn't it? Thanks, > 4. write data at 8192 offset. > --> f2fs_write_begin > -> -ENOSPC = f2fs_convert_inline_page > -> f2fs_write_failed > -> truncate_blocks > -> truncate_inline_inode > BUG_ON, since i_size is 4096. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/inline.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c > index 153c5e7..d3e0599 100644 > --- a/fs/f2fs/inline.c > +++ b/fs/f2fs/inline.c > @@ -54,13 +54,6 @@ bool truncate_inline_inode(struct page *ipage, u64 from) > { > void *addr; > > - /* > - * we should never truncate inline data past max inline data size, > - * because we always convert inline inode to normal one before > - * truncating real data if new size is past max inline data size. > - */ > - f2fs_bug_on(F2FS_P_SB(ipage), from > MAX_INLINE_DATA); > - > if (from >= MAX_INLINE_DATA) > return false; > > -- > 2.1.1 > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel