summary refs log tree commit diff
path: root/mm/backing-dev.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2010-08-04 13:34:31 +0200
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 18:53:57 +0200
commit6bf05d03ea8d00bb53e0642f94a5a6815be2edb6 (patch)
treed36ea43efb9306fa4ff2fdb8f579fb661cad61e8 /mm/backing-dev.c
parente7f52dfb4f378ea1bbfd4476f4e8ba42f5fb332c (diff)
downloadlinux-6bf05d03ea8d00bb53e0642f94a5a6815be2edb6.tar.gz
writeback: fix bad _bh spinlock nesting
Fix a bug where a lock is _bh nested within another _bh lock,
but forgets to use the _bh variant for unlock.

Further more, it's not necessary to test _bh locks, the inner lock
can just use spin_lock(). So fix up the bug by making that change.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r--mm/backing-dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 0b8ee66993dd..08d357522e78 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -415,7 +415,8 @@ static int bdi_forker_thread(void *ptr)
 				break;
 			}
 
-			spin_lock_bh(&bdi->wb_lock);
+			spin_lock(&bdi->wb_lock);
+
 			/*
 			 * If there is no work to do and the bdi thread was
 			 * inactive long enough - kill it. The wb_lock is taken
@@ -432,7 +433,7 @@ static int bdi_forker_thread(void *ptr)
 				action = KILL_THREAD;
 				break;
 			}
-			spin_unlock_bh(&bdi->wb_lock);
+			spin_unlock(&bdi->wb_lock);
 		}
 		spin_unlock_bh(&bdi_lock);