linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hujianyang <hujianyang@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: Space leak in f2fs
Date: Thu, 14 May 2015 09:40:25 +0800	[thread overview]
Message-ID: <5553FD09.9030508@huawei.com> (raw)
In-Reply-To: <20150514002417.GC68412@jaegeuk-mac02>

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

  reply	other threads:[~2015-05-14  1:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  7:17 Space leak in f2fs hujianyang
2015-05-13 17:46 ` [f2fs-dev] " Jaegeuk Kim
2015-05-14  0:24   ` Jaegeuk Kim
2015-05-14  1:40     ` hujianyang [this message]
2015-05-14  1:45       ` [f2fs-dev] " Jaegeuk Kim
2015-05-14 21:14       ` Jaegeuk Kim
2015-05-15  8:31         ` Chao Yu
2015-05-16  0:55           ` Jaegeuk Kim
2015-05-18  2:43             ` Chao Yu
2015-05-18  2:50               ` Nicholas Krause
2015-05-18  5:44               ` [f2fs-dev] " Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5553FD09.9030508@huawei.com \
    --to=hujianyang@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).