From 142191333e91c13aac6e6c2e718867a6b5f4088b Mon Sep 17 00:00:00 2001 From: plougher Date: Sat, 31 Jan 2009 07:32:35 +0000 Subject: Extend cache lock holding in squashfs_cache_put Signed-off-by: Phillip Lougher --- kernel/fs/squashfs/cache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/fs/squashfs/cache.c b/kernel/fs/squashfs/cache.c index 2d74f02..b2bc4de 100644 --- a/kernel/fs/squashfs/cache.c +++ b/kernel/fs/squashfs/cache.c @@ -173,16 +173,17 @@ void squashfs_cache_put(struct squashfs_cache_entry *entry) entry->refcount--; if (entry->refcount == 0) { cache->unused++; - spin_unlock(&cache->lock); /* * If there's any processes waiting for a block to become * available, wake one up. */ - if (cache->num_waiters) + if (cache->num_waiters) { + spin_unlock(&cache->lock); wake_up(&cache->wait_queue); - } else { - spin_unlock(&cache->lock); + return; + } } + spin_unlock(&cache->lock); } -- cgit v1.2.3