aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-01-16 16:20:40 +0900
committerrogersb11 <brettrogers11@gmail.com>2016-02-13 21:30:31 -0500
commitc6ab8e19db8972a9d20d7b7f5ec873efa88102a8 (patch)
tree62b6ac6a6c746639c4015aa052315ce73ff95748 /fs
parent95d56e4d308e0603c68d9006292cd55b4134cabf (diff)
downloadkernel_samsung_smdk4412-c6ab8e19db8972a9d20d7b7f5ec873efa88102a8.zip
kernel_samsung_smdk4412-c6ab8e19db8972a9d20d7b7f5ec873efa88102a8.tar.gz
kernel_samsung_smdk4412-c6ab8e19db8972a9d20d7b7f5ec873efa88102a8.tar.bz2
f2fs: avoid f2fs_balance_fs call during pageout
This patch should resolve the following bug. ========================================================= [ INFO: possible irq lock inversion dependency detected ] 3.13.0-rc5.f2fs+ #6 Not tainted --------------------------------------------------------- kswapd0/41 just changed the state of lock: (&sbi->gc_mutex){+.+.-.}, at: [<ffffffffa030503e>] f2fs_balance_fs+0xae/0xd0 [f2fs] but this lock took another, RECLAIM_FS-READ-unsafe lock in the past: (&sbi->cp_rwsem){++++.?} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Chain exists of: &sbi->gc_mutex --> &sbi->cp_mutex --> &sbi->cp_rwsem Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->cp_rwsem); local_irq_disable(); lock(&sbi->gc_mutex); lock(&sbi->cp_mutex); <Interrupt> lock(&sbi->gc_mutex); *** DEADLOCK *** This bug is due to the f2fs_balance_fs call in f2fs_write_data_page. If f2fs_write_data_page is triggered by wbc->for_reclaim via kswapd, it should not call f2fs_balance_fs which tries to get a mutex grabbed by original syscall flow. Change-Id: I795c071696885b5d048750fb10ae53594f896a2f Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 69713ef..0cbab8a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -842,8 +842,10 @@ write:
else if (err)
goto redirty_out;
- if (wbc->for_reclaim)
+ if (wbc->for_reclaim) {
f2fs_submit_merged_bio(sbi, DATA, WRITE);
+ need_balance_fs = false;
+ }
clear_cold_data(page);
out: