diff options
| -rw-r--r-- | include/linux/sunrpc/cache.h | 1 | ||||
| -rw-r--r-- | net/sunrpc/cache.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 303399b1ba59..8419f7dbdab2 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -57,6 +57,7 @@ struct cache_head { | |||
| 57 | #define CACHE_VALID 0 /* Entry contains valid data */ | 57 | #define CACHE_VALID 0 /* Entry contains valid data */ |
| 58 | #define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */ | 58 | #define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */ |
| 59 | #define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/ | 59 | #define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/ |
| 60 | #define CACHE_CLEANED 3 /* Entry has been cleaned from cache */ | ||
| 60 | 61 | ||
| 61 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 62 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
| 62 | 63 | ||
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 29c463396a2d..b12144c5edd0 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
| @@ -306,7 +306,7 @@ EXPORT_SYMBOL_GPL(cache_check); | |||
| 306 | * a current pointer into that list and into the table | 306 | * a current pointer into that list and into the table |
| 307 | * for that entry. | 307 | * for that entry. |
| 308 | * | 308 | * |
| 309 | * Each time clean_cache is called it finds the next non-empty entry | 309 | * Each time cache_clean is called it finds the next non-empty entry |
| 310 | * in the current table and walks the list in that entry | 310 | * in the current table and walks the list in that entry |
| 311 | * looking for entries that can be removed. | 311 | * looking for entries that can be removed. |
| 312 | * | 312 | * |
| @@ -453,6 +453,7 @@ static int cache_clean(void) | |||
| 453 | current_index ++; | 453 | current_index ++; |
| 454 | spin_unlock(&cache_list_lock); | 454 | spin_unlock(&cache_list_lock); |
| 455 | if (ch) { | 455 | if (ch) { |
| 456 | set_bit(CACHE_CLEANED, &ch->flags); | ||
| 456 | cache_fresh_unlocked(ch, d); | 457 | cache_fresh_unlocked(ch, d); |
| 457 | cache_put(ch, d); | 458 | cache_put(ch, d); |
| 458 | } | 459 | } |
| @@ -1178,6 +1179,9 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) | |||
| 1178 | warn_no_listener(detail); | 1179 | warn_no_listener(detail); |
| 1179 | return -EINVAL; | 1180 | return -EINVAL; |
| 1180 | } | 1181 | } |
| 1182 | if (test_bit(CACHE_CLEANED, &h->flags)) | ||
| 1183 | /* Too late to make an upcall */ | ||
| 1184 | return -EAGAIN; | ||
| 1181 | 1185 | ||
| 1182 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | 1186 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); |
| 1183 | if (!buf) | 1187 | if (!buf) |
