diff options
author | plougher <plougher> | 2009-01-31 07:32:35 +0000 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:34:12 -0800 |
commit | 142191333e91c13aac6e6c2e718867a6b5f4088b (patch) | |
tree | 803a04c2705d3fa98064715c8027add215e8f843 /kernel | |
parent | dc0c9e8537384bfa3310bd27700ebff9903a9a2d (diff) | |
download | squashfs-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.c | 9 |
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); } |