From mboxrd@z Thu Jan 1 00:00:00 1970 From: hujianyang Subject: Re: Space leak in f2fs Date: Thu, 14 May 2015 09:40:25 +0800 Message-ID: <5553FD09.9030508@huawei.com> References: <5552FA7D.7000704@huawei.com> <20150513174417.GA56247@jaegeuk-mac02.mot.com> <20150514002417.GC68412@jaegeuk-mac02> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel@vger.kernel.org" , linux-f2fs-devel@lists.sourceforge.net To: Jaegeuk Kim Return-path: In-Reply-To: <20150514002417.GC68412@jaegeuk-mac02> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net List-Id: linux-fsdevel.vger.kernel.org Hi Jaegeuk, I've tested this patch. It's OK now. Seems this problem is fixed. I'd like to push this patch to my local tree and run a formal stress test next week. Will you push this patch to f2fs-dev branch? If you have other modification to this fix, please let me know. Thanks very much! Hu On 2015/5/14 8:24, Jaegeuk Kim wrote: > Hi Hu, > > Found a bug in the previous patch. > Could you check this out? > > Thanks, > > --- > fs/f2fs/super.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 19438f2..647591b 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -431,8 +431,17 @@ static int f2fs_drop_inode(struct inode *inode) > * - f2fs_gc -> iput -> evict > * - inode_wait_for_writeback(inode) > */ > - if (!inode_unhashed(inode) && inode->i_state & I_SYNC) > + if (!inode_unhashed(inode) && inode->i_state & I_SYNC) { > + if (!inode->i_nlink && !is_bad_inode(inode)) { > + spin_unlock(&inode->i_lock); > + i_size_write(inode, 0); > + > + if (F2FS_HAS_BLOCKS(inode)) > + f2fs_truncate(inode); > + spin_lock(&inode->i_lock); > + } > return 0; > + } > return generic_drop_inode(inode); > } > > ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y