Re: [f2fs-dev] [PATCH] f2fs: Fix bad unlock balance detected.

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

 



The blocked means gc can't proceed anymore due to not enough free sections.
Look at the f2fs_gc -> do_garbage_collect -> gc_node_segment and gc_data_segment.
Before returning GC_BLOCKED as gc_status, mutex_lock(&sbi->cp_mutex) and blokc_operation(sbi) is called.
So unblock_operations should always be called.

On 월, 2013-01-28 at 19:03 +0800, majianpeng wrote:
> Only !blocked is true,it can call the unblock_operations in func write_checkpoint.
> 
> Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
> ---
>  fs/f2fs/checkpoint.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index ff3c843..76308d3 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -760,8 +760,10 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool blocked, bool is_umount)
>  	/* unlock all the fs_lock[] in do_checkpoint() */
>  	do_checkpoint(sbi, is_umount);
>  
> -	unblock_operations(sbi);
> -	mutex_unlock(&sbi->cp_mutex);
> +	if (!blocked) {
> +		unblock_operations(sbi);
> +		mutex_unlock(&sbi->cp_mutex);
> +	}
>  }
>  
>  void init_orphan_info(struct f2fs_sb_info *sbi)


--
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