From: Chao Yu Subject: Re: [PATCH] f2fs: fix an error return value in truncate_partial_data_page Date: Thu, 2 Mar 2017 09:41:09 +0800 Message-ID: References: <20170228123241.5070-1-heyunlei@huawei.com> <98366c6a-4bcd-44cc-4143-a22a359db63d@huawei.com> <20170301193250.GB18600@jaegeuk.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cjFkM-0007Wu-EW for linux-f2fs-devel@lists.sourceforge.net; Thu, 02 Mar 2017 01:41:34 +0000 Received: from [45.249.212.189] (helo=dggrg03-dlp.huawei.com) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1cjFkL-0004vz-4D for linux-f2fs-devel@lists.sourceforge.net; Thu, 02 Mar 2017 01:41:34 +0000 In-Reply-To: <20170301193250.GB18600@jaegeuk.local> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net On 2017/3/2 3:32, Jaegeuk Kim wrote: > On 03/01, Chao Yu wrote: >> On 2017/2/28 20:32, Yunlei He wrote: >>> This patch fix a error return value in truncate_partial_data_page >>> >>> Signed-off-by: Yunlei He >>> --- >>> fs/f2fs/file.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>> index c6ca00c..c186d75 100644 >>> --- a/fs/f2fs/file.c >>> +++ b/fs/f2fs/file.c >>> @@ -529,7 +529,7 @@ static int truncate_partial_data_page(struct inode *inode, u64 from, >>> >>> page = get_lock_data_page(inode, index, true); >>> if (IS_ERR(page)) >>> - return 0; >>> + return page; >> >> return PTR_ERR(page); > > Do we need this? > > return PTR_ERR(page) == -ENOENT ? 0 : PTR_ERR(page); Oh, right, agreed. :) Thanks, > > Thanks, > >> >> Thanks, >> >>> truncate_out: >>> f2fs_wait_on_page_writeback(page, DATA, true); >>> zero_user(page, offset, PAGE_SIZE - offset); >>> > > . > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot