aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorplougher <plougher>2009-01-31 07:32:35 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:34:12 -0800
commit142191333e91c13aac6e6c2e718867a6b5f4088b (patch)
tree803a04c2705d3fa98064715c8027add215e8f843 /kernel
parentdc0c9e8537384bfa3310bd27700ebff9903a9a2d (diff)
downloadsquashfs-tools-142191333e91c13aac6e6c2e718867a6b5f4088b.tar.gz
Extend cache lock holding in squashfs_cache_put
Signed-off-by: Phillip Lougher <phillip@logopolis.(none)>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fs/squashfs/cache.c9
1 files changed, 5 insertions, 4 deletions
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);
}