From a4a3b30886f11d5c53da8b65b791564a748bf9b6 Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Tue, 12 Apr 2011 21:08:38 +0900 Subject: [PATCH] --- yaml --- r: 250106 b: refs/heads/master c: 700309295551ef9217e4ae00a5b1d3030fc5438c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/fat/cache.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index dfbe5b00a95d..d7078df45696 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 384f5c96ea05aba24a11172ebd6f5d427ca199fc +refs/heads/master: 700309295551ef9217e4ae00a5b1d3030fc5438c diff --git a/trunk/fs/fat/cache.c b/trunk/fs/fat/cache.c index ae8200f84e39..1cc7038e273d 100644 --- a/trunk/fs/fat/cache.c +++ b/trunk/fs/fat/cache.c @@ -151,6 +151,13 @@ static void fat_cache_add(struct inode *inode, struct fat_cache_id *new) spin_unlock(&MSDOS_I(inode)->cache_lru_lock); tmp = fat_cache_alloc(inode); + if (!tmp) { + spin_lock(&MSDOS_I(inode)->cache_lru_lock); + MSDOS_I(inode)->nr_caches--; + spin_unlock(&MSDOS_I(inode)->cache_lru_lock); + return; + } + spin_lock(&MSDOS_I(inode)->cache_lru_lock); cache = fat_cache_merge(inode, new); if (cache != NULL) {