Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638AbbF3DBJ (ORCPT ); Mon, 29 Jun 2015 23:01:09 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59222 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753673AbbF3DBA (ORCPT ); Mon, 29 Jun 2015 23:01:00 -0400 X-AuditID: cbfee61a-f79516d000006302-9d-5592066abf24 From: Chao Yu To: "'Jaegeuk Kim'" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1435603176-63219-1-git-send-email-jaegeuk@kernel.org> <1435603176-63219-4-git-send-email-jaegeuk@kernel.org> In-reply-to: <1435603176-63219-4-git-send-email-jaegeuk@kernel.org> Subject: RE: [f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents Date: Tue, 30 Jun 2015 11:00:13 +0800 Message-id: <00e501d0b2e0$fd65f3c0$f831db40$@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: AQIP2ZWuDS0opyTuw8lIx+7z0YD0SgGYsMERnTlBOnA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKLMWRmVeSWpSXmKPExsVy+t9jQd0stkmhBse+2Fg8WT+L2eLSIneL PXtPslhc3jWHzYHFY9OqTjaP3Qs+M3l83iQXwBzFZZOSmpNZllqkb5fAlbFuy1fGgq9iFY/P HGZsYFwp1MXIySEhYCJxf9okRghbTOLCvfVsXYxcHEIC0xkl7m9ZzAqSEBJ4xSix8o4viM0m oCKxvOM/E4gtIqAm0btvCpjNLJApMaH/BTtEfbVE2/SJLCA2p4CzxMbpe8BsYYFoiRnti8Dq WQRUJS6//gO2mFfAUuLTtxnMELagxI/J91ggZmpJrN95HGq+vMTmNW+ZIQ5VkNhx9jUjxA1W EnMeL2KEqBGX2HjkFssERqFZSEbNQjJqFpJRs5C0LGBkWcUomlqQXFCclJ5rqFecmFtcmpeu l5yfu4kRHPjPpHYwrmywOMQowMGoxMN7g3lSqBBrYllxZe4hRgkOZiURXqbYiaFCvCmJlVWp RfnxRaU5qcWHGKU5WJTEeU/m+4QKCaQnlqRmp6YWpBbBZJk4OKUaGN2rZjTb1n0Wt5QrPid/ +6/LNespwiJdRgcKm0WNd7y33htwR/eihjvfjhuLq2/bsCeEHnVblb+h4cXHgFOlzrNe3nyh w51wcq/qsrOZH98Urhdun/Hko7Daku1BDO+bDGsPVAoZHbH5xeD7bPZ5rbZ1eWevihe+r7Ny X1X4/cfLMu2jsoHTopVYijMSDbWYi4oTAVl8p6l4AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3100 Lines: 83 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Tuesday, June 30, 2015 2:39 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 04/12] f2fs: remove wrong f2fs_bug_on when merging extents > > In f2fs_update_extent_tree, if there is existing extent, f2fs tries to split > it with two parts. > In each trial, __insert_extent_tree checks __is_front/back_mergeable, and then > if it hits to go, there is f2fs_bug_on(!den), which triggers a kernel panic. > > Actually, we don't need to check this. Instead, we can do __try_back_merge only > when there exists a den pointer. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/data.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 9bedfa8..7817167 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -519,19 +519,19 @@ static struct extent_node *__insert_extent_tree(struct f2fs_sb_info *sbi, > > if (ei->fofs < en->ei.fofs) { > if (__is_front_mergeable(ei, &en->ei)) { > - f2fs_bug_on(sbi, !den); I add a BUG_ON here because we assume that in extent cache there is no such two extents whose mapping address is continuous but without being merged, since whenever we add a new extent(not splitted one) into cache, we tries to merge it frontward/backward, then all extent with continuous mapping should be merged. So when we split one extent to two parts, each part should not be able to merge with others. Otherwise it should be a bug. Is there some special case to trigger this BUG_ON? Thanks, > en->ei.fofs = ei->fofs; > en->ei.blk = ei->blk; > en->ei.len += ei->len; > - *den = __try_back_merge(sbi, et, en); > + if (den) > + *den = __try_back_merge(sbi, et, en); > return en; > } > p = &(*p)->rb_left; > } else if (ei->fofs >= en->ei.fofs + en->ei.len) { > if (__is_back_mergeable(ei, &en->ei)) { > - f2fs_bug_on(sbi, !den); > en->ei.len += ei->len; > - *den = __try_front_merge(sbi, et, en); > + if (den) > + *den = __try_front_merge(sbi, et, en); > return en; > } > p = &(*p)->rb_right; > -- > 2.1.1 > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/