diff options
author | plougher <plougher> | 2009-01-31 07:33:07 +0000 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:34:12 -0800 |
commit | 62eee33cd67617db0c43441ba4123d0276b836f6 (patch) | |
tree | d113368a68f6ad5315eb21b75fabcc13d7aea369 /kernel | |
parent | 01feb21e74963aa0cb49c7bd4bb638cb08df2a7c (diff) | |
download | squashfs-tools-62eee33cd67617db0c43441ba4123d0276b836f6.tar.gz |
squashfs_cache_get: extend cache lock holding
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fs/squashfs/cache.c | 12 |
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; } |