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 X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99BF5C433DF for ; Fri, 19 Jun 2020 22:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DA80223BE for ; Fri, 19 Jun 2020 22:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592606878; bh=VEWCMebtebCiHARyRfJKcj78UzbRt8EmH3qeu4CJQN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=UbCqPlTPVm5FPeEy2F+x8dVaSnPFCMRJUn4Yg1R+Ujop8jlyZ9LPWIpYhhDsuCqr/ hlloOXNMXwVOVo0RBub/OoZh+mgc5+tx/8BgiLXqJOwWnSCozyTxmpfK8h6IUhbxiR gq3tg7Z3CeZljrQCu+/S+aShRc7VfElEe3kxgyBE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729705AbgFSWr5 (ORCPT ); Fri, 19 Jun 2020 18:47:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:49814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729616AbgFSWr4 (ORCPT ); Fri, 19 Jun 2020 18:47:56 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE7AC221F2; Fri, 19 Jun 2020 22:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592606875; bh=VEWCMebtebCiHARyRfJKcj78UzbRt8EmH3qeu4CJQN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mcg3MHnOvEkenGVjNnOfmMoSF2aPUSAJQGrfWdH2n+CvGroVVrjURLDRvLQQBE+vB 6EpNoCKM6m2jNZkvvekFSs1EB3P8eOFkHAR8/evYrfzaVv2h1Mo+XVUWGS00+SyEgr 7RIvcLpZC/FJYHD3tf4GOPBEGait2SnYcg9cSKmU= Date: Fri, 19 Jun 2020 15:47:55 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, chao@kernel.org Subject: Re: [PATCH 1/5] f2fs: fix to wait page writeback before update Message-ID: <20200619224755.GA60059@google.com> References: <20200618063625.110273-1-yuchao0@huawei.com> <20200618235932.GA227771@google.com> <20200619054922.GC227771@google.com> <3634ef79-5903-449d-0d52-3d5566481863@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3634ef79-5903-449d-0d52-3d5566481863@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/19, Chao Yu wrote: > On 2020/6/19 13:49, Jaegeuk Kim wrote: > > On 06/19, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2020/6/19 7:59, Jaegeuk Kim wrote: > >>> Hi Chao, > >>> > >>> On 06/18, Chao Yu wrote: > >>>> to make page content stable for special device like raid. > >>> > >>> Could you elaborate the problem a bit? > >> > >> Some devices like raid5 wants page content to be stable, because > >> it will calculate parity info based page content, if page is not > >> stable, parity info could be corrupted, result in data inconsistency > >> in stripe. > > > > I don't get the point, since those pages are brand new pages which were not > > modified before. If it's on writeback, we should not modify them regardless > > of whatever raid configuration. For example, f2fs_new_node_page() waits for > > writeback. Am I missing something? > > I think we should use f2fs_bug_on(, PageWriteback()) rather than > f2fs_wait_on_page_writeback() for brand new page which is allocated just now. > For other paths, we can keep rule that waiting for writeback before updating. > > How do you think? > > Thanks, > > > > >> > >> Thanks, > >> > >>> > >>>> > >>>> Signed-off-by: Chao Yu > >>>> --- > >>>> fs/f2fs/dir.c | 2 ++ > >>>> fs/f2fs/extent_cache.c | 18 +++++++++--------- > >>>> fs/f2fs/f2fs.h | 2 +- > >>>> fs/f2fs/file.c | 1 + > >>>> fs/f2fs/inline.c | 2 ++ > >>>> fs/f2fs/inode.c | 3 +-- > >>>> 6 files changed, 16 insertions(+), 12 deletions(-) > >>>> > >>>> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c > >>>> index d35976785e8c..91e86747a604 100644 > >>>> --- a/fs/f2fs/dir.c > >>>> +++ b/fs/f2fs/dir.c > >>>> @@ -495,6 +495,8 @@ static int make_empty_dir(struct inode *inode, > >>>> if (IS_ERR(dentry_page)) > >>>> return PTR_ERR(dentry_page); > >>>> > >>>> + f2fs_bug_on(F2FS_I_SB(inode), PageWriteback(dentry_page)); > >>>> + > >>>> dentry_blk = page_address(dentry_page); > >>>> > >>>> make_dentry_ptr_block(NULL, &d, dentry_blk); > >>>> diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c > >>>> index e60078460ad1..686c68b98610 100644 > >>>> --- a/fs/f2fs/extent_cache.c > >>>> +++ b/fs/f2fs/extent_cache.c > >>>> @@ -325,9 +325,10 @@ static void __drop_largest_extent(struct extent_tree *et, > >>>> } > >>>> > >>>> /* return true, if inode page is changed */ > >>>> -static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) > >>>> +static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > >>>> { > >>>> struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > >>>> + struct f2fs_extent *i_ext = ipage ? &F2FS_INODE(ipage)->i_ext : NULL; > >>>> struct extent_tree *et; > >>>> struct extent_node *en; > >>>> struct extent_info ei; > >>>> @@ -335,16 +336,18 @@ static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_e > >>>> if (!f2fs_may_extent_tree(inode)) { > >>>> /* drop largest extent */ > >>>> if (i_ext && i_ext->len) { > >>>> + f2fs_wait_on_page_writeback(ipage, NODE, true, true); > >>>> i_ext->len = 0; > >>>> - return true; > >>>> + set_page_dirty(ipage); > >>>> + return; > >>>> } > >>>> - return false; > >>>> + return; > >>>> } > >>>> > >>>> et = __grab_extent_tree(inode); > >>>> > >>>> if (!i_ext || !i_ext->len) > >>>> - return false; > >>>> + return; > >>>> > >>>> get_extent_info(&ei, i_ext); > >>>> > >>>> @@ -360,17 +363,14 @@ static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_e > >>>> } > >>>> out: > >>>> write_unlock(&et->lock); > >>>> - return false; > >>>> } > >>>> > >>>> -bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) > >>>> +void f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > >>>> { > >>>> - bool ret = __f2fs_init_extent_tree(inode, i_ext); > >>>> + __f2fs_init_extent_tree(inode, ipage); > >>>> > >>>> if (!F2FS_I(inode)->extent_tree) > >>>> set_inode_flag(inode, FI_NO_EXTENT); > >>>> - > >>>> - return ret; > >>>> } > >>>> > >>>> static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, > >>>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > >>>> index b35a50f4953c..326c12fa0da5 100644 > >>>> --- a/fs/f2fs/f2fs.h > >>>> +++ b/fs/f2fs/f2fs.h > >>>> @@ -3795,7 +3795,7 @@ struct rb_entry *f2fs_lookup_rb_tree_ret(struct rb_root_cached *root, > >>>> bool f2fs_check_rb_tree_consistence(struct f2fs_sb_info *sbi, > >>>> struct rb_root_cached *root); > >>>> unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink); > >>>> -bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext); > >>>> +void f2fs_init_extent_tree(struct inode *inode, struct page *ipage); > >>>> void f2fs_drop_extent_tree(struct inode *inode); > >>>> unsigned int f2fs_destroy_extent_node(struct inode *inode); > >>>> void f2fs_destroy_extent_tree(struct inode *inode); > >>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > >>>> index 3268f8dd59bb..1862073b96d2 100644 > >>>> --- a/fs/f2fs/file.c > >>>> +++ b/fs/f2fs/file.c > >>>> @@ -1250,6 +1250,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, > >>>> f2fs_put_page(psrc, 1); > >>>> return PTR_ERR(pdst); > >>>> } > >>>> + f2fs_wait_on_page_writeback(pdst, DATA, true, true); Do you mean pdst can be under writeback? > >>>> f2fs_copy_page(psrc, pdst); > >>>> set_page_dirty(pdst); > >>>> f2fs_put_page(pdst, 1); > >>>> diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c > >>>> index dbade310dc79..4bcbc486c9e2 100644 > >>>> --- a/fs/f2fs/inline.c > >>>> +++ b/fs/f2fs/inline.c > >>>> @@ -340,6 +340,8 @@ int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent, > >>>> struct f2fs_dentry_ptr d; > >>>> void *inline_dentry; > >>>> > >>>> + f2fs_wait_on_page_writeback(ipage, NODE, true, true); > >>>> + > >>>> inline_dentry = inline_data_addr(inode, ipage); > >>>> > >>>> make_dentry_ptr_inline(inode, &d, inline_dentry); > >>>> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > >>>> index 44582a4db513..7c156eb26dd7 100644 > >>>> --- a/fs/f2fs/inode.c > >>>> +++ b/fs/f2fs/inode.c > >>>> @@ -367,8 +367,7 @@ static int do_read_inode(struct inode *inode) > >>>> fi->i_pino = le32_to_cpu(ri->i_pino); > >>>> fi->i_dir_level = ri->i_dir_level; > >>>> > >>>> - if (f2fs_init_extent_tree(inode, &ri->i_ext)) > >>>> - set_page_dirty(node_page); > >>>> + f2fs_init_extent_tree(inode, node_page); > >>>> > >>>> get_inline_info(inode, ri); > >>>> > >>>> -- > >>>> 2.18.0.rc1 > >>> . > >>> > > . > > 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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78415C433DF for ; Fri, 19 Jun 2020 22:48:06 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46B81221F2 for ; Fri, 19 Jun 2020 22:48:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="B+mg+O4D"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="DUVuM/jm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mcg3MHnO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46B81221F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jmPnp-0000Bw-9o; Fri, 19 Jun 2020 22:48:05 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmPnn-0000Bo-O9 for linux-f2fs-devel@lists.sourceforge.net; Fri, 19 Jun 2020 22:48:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8+oEUDGMQeI/b4XYYDCRyWUTwxqg+0wuln09GYPgTnc=; b=B+mg+O4DZ5aKzsi6pOXcN1Pjq5 Kq3fACB/S6eFQHgIfn0fZQuGlv9kiUaYUyljRBBdpNjw4CS2merv9fEZONcnpG95o3Wky8T59Nu5b u1RK/Z0s56CxfgkSdj//iZEILfKkCKqiYUxl8RXH6fQRlpn6doy8KjEn53yUOONUYhWk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8+oEUDGMQeI/b4XYYDCRyWUTwxqg+0wuln09GYPgTnc=; b=DUVuM/jmpLQY4IXhP5CEjNIPNE 3pPeBJbnfdmq6h1dZEPgeSATfwdjkak2EbFIVX5s4g8EsCebS+ZLNIWhqmeALWvaUhRWTZyKT+5eZ 4wU8gD8M5punwZBmNLPgRZDP28jMANnVVFgCRksIKeS3V8OhyieHFfPPCHu8lSSSSUIU=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jmPnl-00Ahi3-9N for linux-f2fs-devel@lists.sourceforge.net; Fri, 19 Jun 2020 22:48:03 +0000 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE7AC221F2; Fri, 19 Jun 2020 22:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592606875; bh=VEWCMebtebCiHARyRfJKcj78UzbRt8EmH3qeu4CJQN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mcg3MHnOvEkenGVjNnOfmMoSF2aPUSAJQGrfWdH2n+CvGroVVrjURLDRvLQQBE+vB 6EpNoCKM6m2jNZkvvekFSs1EB3P8eOFkHAR8/evYrfzaVv2h1Mo+XVUWGS00+SyEgr 7RIvcLpZC/FJYHD3tf4GOPBEGait2SnYcg9cSKmU= Date: Fri, 19 Jun 2020 15:47:55 -0700 From: Jaegeuk Kim To: Chao Yu Message-ID: <20200619224755.GA60059@google.com> References: <20200618063625.110273-1-yuchao0@huawei.com> <20200618235932.GA227771@google.com> <20200619054922.GC227771@google.com> <3634ef79-5903-449d-0d52-3d5566481863@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3634ef79-5903-449d-0d52-3d5566481863@huawei.com> X-Headers-End: 1jmPnl-00Ahi3-9N Subject: Re: [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 06/19, Chao Yu wrote: > On 2020/6/19 13:49, Jaegeuk Kim wrote: > > On 06/19, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2020/6/19 7:59, Jaegeuk Kim wrote: > >>> Hi Chao, > >>> > >>> On 06/18, Chao Yu wrote: > >>>> to make page content stable for special device like raid. > >>> > >>> Could you elaborate the problem a bit? > >> > >> Some devices like raid5 wants page content to be stable, because > >> it will calculate parity info based page content, if page is not > >> stable, parity info could be corrupted, result in data inconsistency > >> in stripe. > > > > I don't get the point, since those pages are brand new pages which were not > > modified before. If it's on writeback, we should not modify them regardless > > of whatever raid configuration. For example, f2fs_new_node_page() waits for > > writeback. Am I missing something? > > I think we should use f2fs_bug_on(, PageWriteback()) rather than > f2fs_wait_on_page_writeback() for brand new page which is allocated just now. > For other paths, we can keep rule that waiting for writeback before updating. > > How do you think? > > Thanks, > > > > >> > >> Thanks, > >> > >>> > >>>> > >>>> Signed-off-by: Chao Yu > >>>> --- > >>>> fs/f2fs/dir.c | 2 ++ > >>>> fs/f2fs/extent_cache.c | 18 +++++++++--------- > >>>> fs/f2fs/f2fs.h | 2 +- > >>>> fs/f2fs/file.c | 1 + > >>>> fs/f2fs/inline.c | 2 ++ > >>>> fs/f2fs/inode.c | 3 +-- > >>>> 6 files changed, 16 insertions(+), 12 deletions(-) > >>>> > >>>> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c > >>>> index d35976785e8c..91e86747a604 100644 > >>>> --- a/fs/f2fs/dir.c > >>>> +++ b/fs/f2fs/dir.c > >>>> @@ -495,6 +495,8 @@ static int make_empty_dir(struct inode *inode, > >>>> if (IS_ERR(dentry_page)) > >>>> return PTR_ERR(dentry_page); > >>>> > >>>> + f2fs_bug_on(F2FS_I_SB(inode), PageWriteback(dentry_page)); > >>>> + > >>>> dentry_blk = page_address(dentry_page); > >>>> > >>>> make_dentry_ptr_block(NULL, &d, dentry_blk); > >>>> diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c > >>>> index e60078460ad1..686c68b98610 100644 > >>>> --- a/fs/f2fs/extent_cache.c > >>>> +++ b/fs/f2fs/extent_cache.c > >>>> @@ -325,9 +325,10 @@ static void __drop_largest_extent(struct extent_tree *et, > >>>> } > >>>> > >>>> /* return true, if inode page is changed */ > >>>> -static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) > >>>> +static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > >>>> { > >>>> struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > >>>> + struct f2fs_extent *i_ext = ipage ? &F2FS_INODE(ipage)->i_ext : NULL; > >>>> struct extent_tree *et; > >>>> struct extent_node *en; > >>>> struct extent_info ei; > >>>> @@ -335,16 +336,18 @@ static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_e > >>>> if (!f2fs_may_extent_tree(inode)) { > >>>> /* drop largest extent */ > >>>> if (i_ext && i_ext->len) { > >>>> + f2fs_wait_on_page_writeback(ipage, NODE, true, true); > >>>> i_ext->len = 0; > >>>> - return true; > >>>> + set_page_dirty(ipage); > >>>> + return; > >>>> } > >>>> - return false; > >>>> + return; > >>>> } > >>>> > >>>> et = __grab_extent_tree(inode); > >>>> > >>>> if (!i_ext || !i_ext->len) > >>>> - return false; > >>>> + return; > >>>> > >>>> get_extent_info(&ei, i_ext); > >>>> > >>>> @@ -360,17 +363,14 @@ static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_e > >>>> } > >>>> out: > >>>> write_unlock(&et->lock); > >>>> - return false; > >>>> } > >>>> > >>>> -bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) > >>>> +void f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > >>>> { > >>>> - bool ret = __f2fs_init_extent_tree(inode, i_ext); > >>>> + __f2fs_init_extent_tree(inode, ipage); > >>>> > >>>> if (!F2FS_I(inode)->extent_tree) > >>>> set_inode_flag(inode, FI_NO_EXTENT); > >>>> - > >>>> - return ret; > >>>> } > >>>> > >>>> static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, > >>>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > >>>> index b35a50f4953c..326c12fa0da5 100644 > >>>> --- a/fs/f2fs/f2fs.h > >>>> +++ b/fs/f2fs/f2fs.h > >>>> @@ -3795,7 +3795,7 @@ struct rb_entry *f2fs_lookup_rb_tree_ret(struct rb_root_cached *root, > >>>> bool f2fs_check_rb_tree_consistence(struct f2fs_sb_info *sbi, > >>>> struct rb_root_cached *root); > >>>> unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink); > >>>> -bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext); > >>>> +void f2fs_init_extent_tree(struct inode *inode, struct page *ipage); > >>>> void f2fs_drop_extent_tree(struct inode *inode); > >>>> unsigned int f2fs_destroy_extent_node(struct inode *inode); > >>>> void f2fs_destroy_extent_tree(struct inode *inode); > >>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > >>>> index 3268f8dd59bb..1862073b96d2 100644 > >>>> --- a/fs/f2fs/file.c > >>>> +++ b/fs/f2fs/file.c > >>>> @@ -1250,6 +1250,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, > >>>> f2fs_put_page(psrc, 1); > >>>> return PTR_ERR(pdst); > >>>> } > >>>> + f2fs_wait_on_page_writeback(pdst, DATA, true, true); Do you mean pdst can be under writeback? > >>>> f2fs_copy_page(psrc, pdst); > >>>> set_page_dirty(pdst); > >>>> f2fs_put_page(pdst, 1); > >>>> diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c > >>>> index dbade310dc79..4bcbc486c9e2 100644 > >>>> --- a/fs/f2fs/inline.c > >>>> +++ b/fs/f2fs/inline.c > >>>> @@ -340,6 +340,8 @@ int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent, > >>>> struct f2fs_dentry_ptr d; > >>>> void *inline_dentry; > >>>> > >>>> + f2fs_wait_on_page_writeback(ipage, NODE, true, true); > >>>> + > >>>> inline_dentry = inline_data_addr(inode, ipage); > >>>> > >>>> make_dentry_ptr_inline(inode, &d, inline_dentry); > >>>> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > >>>> index 44582a4db513..7c156eb26dd7 100644 > >>>> --- a/fs/f2fs/inode.c > >>>> +++ b/fs/f2fs/inode.c > >>>> @@ -367,8 +367,7 @@ static int do_read_inode(struct inode *inode) > >>>> fi->i_pino = le32_to_cpu(ri->i_pino); > >>>> fi->i_dir_level = ri->i_dir_level; > >>>> > >>>> - if (f2fs_init_extent_tree(inode, &ri->i_ext)) > >>>> - set_page_dirty(node_page); > >>>> + f2fs_init_extent_tree(inode, node_page); > >>>> > >>>> get_inline_info(inode, ri); > >>>> > >>>> -- > >>>> 2.18.0.rc1 > >>> . > >>> > > . > > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel