]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: Make sure CACHE_NEGATIVE is cleared when a cache entry is updates.
authorAndrew Morton <akpm@osdl.org>
Wed, 19 May 2004 09:39:35 +0000 (02:39 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 19 May 2004 09:39:35 +0000 (02:39 -0700)
From: NeilBrown <neilb@cse.unsw.edu.au>

This is important for update-in-place caches which may change from being
negative to posative.

Thanks to "J.  Bruce Fields" <bfields@fieldses.org> and Olaf Kirch
<okir@suse.de>

include/linux/sunrpc/cache.h

index 18c776d1dc68590b7f83a1850829dfc07f3f6a4c..81e311bbaa4bde777ef1a23ec90800883e3983d1 100644 (file)
@@ -193,8 +193,11 @@ RTN *FNAME ARGS                                                                            \
                                        t2 = tmp; tmp = new; new = t2;                  \
                                }                                                       \
                                if (test_bit(CACHE_NEGATIVE,  &item->MEMBER.flags))     \
-                                        set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);   \
-                               else {UPDATE;}                                          \
+                                       set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);    \
+                               else {                                                  \
+                                       UPDATE;                                         \
+                                       clear_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);  \
+                               }                                                       \
                        }                                                               \
                        if (set||new) write_unlock(&(DETAIL)->hash_lock);               \
                        else read_unlock(&(DETAIL)->hash_lock);                         \