public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes
@ 2013-10-21  7:19 Gu Zheng
  2013-10-22 11:15 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Gu Zheng @ 2013-10-21  7:19 UTC (permalink / raw)
  To: Kim; +Cc: f2fs, fsdevel, linux-kernel

In sync_dirty_dir_inodes(), remove_dirty_dir_inode() will be called
in the callback of filemap_flush to delete and free dirty dir inode entry.
But for the freeing inode entry, missed this step after sbumit data bio,
and this may lead to a dead loop if these is freeing inode entry in
dir_inode_list. So add the delete and free step to fix it.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
 fs/f2fs/checkpoint.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 8d16071..f61838f 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -600,7 +600,16 @@ retry:
 		 * wribacking dentry pages in the freeing inode.
 		 */
 		f2fs_submit_bio(sbi, DATA, true);
+
+		spin_lock(&sbi->dir_inode_lock);
+		list_del(&entry->list);
+#ifdef CONFIG_F2FS_STAT_FS
+		sbi->n_dirty_dirs--;
+#endif
+		spin_unlock(&sbi->dir_inode_lock);
+		kmem_cache_free(inode_entry_slab, entry);
 	}
+
 	goto retry;
 }
 
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes
  2013-10-21  7:19 [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes Gu Zheng
@ 2013-10-22 11:15 ` Jaegeuk Kim
  2013-10-23 10:11   ` Gu Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2013-10-22 11:15 UTC (permalink / raw)
  To: Gu Zheng; +Cc: f2fs, fsdevel, linux-kernel

2013-10-21 (월), 15:19 +0800, Gu Zheng:
> In sync_dirty_dir_inodes(), remove_dirty_dir_inode() will be called
> in the callback of filemap_flush to delete and free dirty dir inode entry.
> But for the freeing inode entry, missed this step after sbumit data bio,
> and this may lead to a dead loop if these is freeing inode entry in
> dir_inode_list. So add the delete and free step to fix it.

Hi Gu,

This dirty inode will be removed by f2fs_evict_inode() after submitting
any pending bio, f2fs_submit_bio().
Thanks,

> 
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
> ---
>  fs/f2fs/checkpoint.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 8d16071..f61838f 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -600,7 +600,16 @@ retry:
>  		 * wribacking dentry pages in the freeing inode.
>  		 */
>  		f2fs_submit_bio(sbi, DATA, true);
> +
> +		spin_lock(&sbi->dir_inode_lock);
> +		list_del(&entry->list);
> +#ifdef CONFIG_F2FS_STAT_FS
> +		sbi->n_dirty_dirs--;
> +#endif
> +		spin_unlock(&sbi->dir_inode_lock);
> +		kmem_cache_free(inode_entry_slab, entry);
>  	}
> +
>  	goto retry;
>  }
>  

-- 
Jaegeuk Kim
Samsung


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes
  2013-10-22 11:15 ` Jaegeuk Kim
@ 2013-10-23 10:11   ` Gu Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Gu Zheng @ 2013-10-23 10:11 UTC (permalink / raw)
  To: jaegeuk.kim; +Cc: f2fs, fsdevel, linux-kernel

Hi Kim,
On 10/22/2013 07:15 PM, Jaegeuk Kim wrote:

> 2013-10-21 (월), 15:19 +0800, Gu Zheng:
>> In sync_dirty_dir_inodes(), remove_dirty_dir_inode() will be called
>> in the callback of filemap_flush to delete and free dirty dir inode entry.
>> But for the freeing inode entry, missed this step after sbumit data bio,
>> and this may lead to a dead loop if these is freeing inode entry in
>> dir_inode_list. So add the delete and free step to fix it.
> 
> Hi Gu,
> 
> This dirty inode will be removed by f2fs_evict_inode() after submitting
> any pending bio, f2fs_submit_bio().

Yeah, got it, thanks for your direction, please ignore this patch.

Regards,
Gu

> Thanks,
> 
>>
>> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
>> ---
>>  fs/f2fs/checkpoint.c |    9 +++++++++
>>  1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index 8d16071..f61838f 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -600,7 +600,16 @@ retry:
>>  		 * wribacking dentry pages in the freeing inode.
>>  		 */
>>  		f2fs_submit_bio(sbi, DATA, true);
>> +
>> +		spin_lock(&sbi->dir_inode_lock);
>> +		list_del(&entry->list);
>> +#ifdef CONFIG_F2FS_STAT_FS
>> +		sbi->n_dirty_dirs--;
>> +#endif
>> +		spin_unlock(&sbi->dir_inode_lock);
>> +		kmem_cache_free(inode_entry_slab, entry);
>>  	}
>> +
>>  	goto retry;
>>  }
>>  
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-23 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21  7:19 [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes Gu Zheng
2013-10-22 11:15 ` Jaegeuk Kim
2013-10-23 10:11   ` Gu Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox