aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fs/squashfs/cache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/fs/squashfs/cache.c b/kernel/fs/squashfs/cache.c
index ec1033e..f15048b 100644
--- a/kernel/fs/squashfs/cache.c
+++ b/kernel/fs/squashfs/cache.c
@@ -113,15 +113,18 @@ struct squashfs_cache_entry *squashfs_cache_get(struct super_block *sb,
entry->error = entry->length;
entry->pending = 0;
- spin_unlock(&cache->lock);
/*
* While filling this entry one or more other processes
* have looked it up in the cache, and have slept
* waiting for it to become available.
*/
- if (entry->num_waiters)
+ if (entry->num_waiters) {
+ spin_unlock(&cache->lock);
wake_up_all(&entry->wait_queue);
+ } else
+ spin_unlock(&cache->lock);
+
goto out;
}
@@ -144,10 +147,9 @@ struct squashfs_cache_entry *squashfs_cache_get(struct super_block *sb,
entry->num_waiters++;
spin_unlock(&cache->lock);
wait_event(entry->wait_queue, !entry->pending);
- goto out;
- }
+ } else
+ spin_unlock(&cache->lock);
- spin_unlock(&cache->lock);
goto out;
}