aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-18 00:29:07 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-20 09:10:04 -0400
commit3cb5ad152b54430f3e5f338c15f8cd434e7160c8 (patch)
tree84f89b065e23b7f174f2c7d777217c6b2d363da6 /fs/f2fs/dir.c
parent50c8cdb35ad8016c52fb2326ef9d65542e3a3e1b (diff)
f2fs: call f2fs_wait_on_page_writeback instead of native function
If a page is on writeback, f2fs can face with deadlock due to under writepages. This is caused by merging IOs inside f2fs, so if it comes to detect, let's throw merged IOs, which is implemented by f2fs_wait_on_page_writeback. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index f3a80ce9ddf5..7c9b17c03675 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -253,7 +253,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
253 struct page *page, struct inode *inode) 253 struct page *page, struct inode *inode)
254{ 254{
255 lock_page(page); 255 lock_page(page);
256 wait_on_page_writeback(page); 256 f2fs_wait_on_page_writeback(page, DATA);
257 de->ino = cpu_to_le32(inode->i_ino); 257 de->ino = cpu_to_le32(inode->i_ino);
258 set_de_type(de, inode); 258 set_de_type(de, inode);
259 kunmap(page); 259 kunmap(page);
@@ -352,14 +352,11 @@ static struct page *init_inode_metadata(struct inode *inode,
352 err = f2fs_init_security(inode, dir, name, page); 352 err = f2fs_init_security(inode, dir, name, page);
353 if (err) 353 if (err)
354 goto put_error; 354 goto put_error;
355
356 wait_on_page_writeback(page);
357 } else { 355 } else {
358 page = get_node_page(F2FS_SB(dir->i_sb), inode->i_ino); 356 page = get_node_page(F2FS_SB(dir->i_sb), inode->i_ino);
359 if (IS_ERR(page)) 357 if (IS_ERR(page))
360 return page; 358 return page;
361 359
362 wait_on_page_writeback(page);
363 set_cold_node(inode, page); 360 set_cold_node(inode, page);
364 } 361 }
365 362
@@ -494,7 +491,7 @@ start:
494 ++level; 491 ++level;
495 goto start; 492 goto start;
496add_dentry: 493add_dentry:
497 wait_on_page_writeback(dentry_page); 494 f2fs_wait_on_page_writeback(dentry_page, DATA);
498 495
499 page = init_inode_metadata(inode, dir, name); 496 page = init_inode_metadata(inode, dir, name);
500 if (IS_ERR(page)) { 497 if (IS_ERR(page)) {
@@ -543,7 +540,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
543 int i; 540 int i;
544 541
545 lock_page(page); 542 lock_page(page);
546 wait_on_page_writeback(page); 543 f2fs_wait_on_page_writeback(page, DATA);
547 544
548 dentry_blk = (struct f2fs_dentry_block *)kaddr; 545 dentry_blk = (struct f2fs_dentry_block *)kaddr;
549 bit_pos = dentry - (struct f2fs_dir_entry *)dentry_blk->dentry; 546 bit_pos = dentry - (struct f2fs_dir_entry *)dentry_blk->dentry;