diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fat/cache.c b/fs/fat/cache.c index ae8200f84e39..1cc7038e273d 100644 --- a/fs/fat/cache.c +++ b/fs/fat/cache.c | |||
@@ -151,6 +151,13 @@ static void fat_cache_add(struct inode *inode, struct fat_cache_id *new) | |||
151 | spin_unlock(&MSDOS_I(inode)->cache_lru_lock); | 151 | spin_unlock(&MSDOS_I(inode)->cache_lru_lock); |
152 | 152 | ||
153 | tmp = fat_cache_alloc(inode); | 153 | tmp = fat_cache_alloc(inode); |
154 | if (!tmp) { | ||
155 | spin_lock(&MSDOS_I(inode)->cache_lru_lock); | ||
156 | MSDOS_I(inode)->nr_caches--; | ||
157 | spin_unlock(&MSDOS_I(inode)->cache_lru_lock); | ||
158 | return; | ||
159 | } | ||
160 | |||
154 | spin_lock(&MSDOS_I(inode)->cache_lru_lock); | 161 | spin_lock(&MSDOS_I(inode)->cache_lru_lock); |
155 | cache = fat_cache_merge(inode, new); | 162 | cache = fat_cache_merge(inode, new); |
156 | if (cache != NULL) { | 163 | if (cache != NULL) { |