Re: [f2fs-dev] Space leak in f2fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
>  }
>  
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux