summaryrefslogtreecommitdiff
path: root/source3/smbd/statcache.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-04-07 20:59:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:31 -0500
commitecc6933a86dfc61b49ce907cf444cc45d2e3f8d5 (patch)
tree5dfc66fa51392babdaa5b97737f65504cc8729d0 /source3/smbd/statcache.c
parentb751f95a256e0309f878ef93e6da9003fbde92d2 (diff)
downloadsamba-ecc6933a86dfc61b49ce907cf444cc45d2e3f8d5.tar.gz
samba-ecc6933a86dfc61b49ce907cf444cc45d2e3f8d5.tar.bz2
samba-ecc6933a86dfc61b49ce907cf444cc45d2e3f8d5.zip
r6240: Fix for bug #2581. Add size limit (in kb) to stat cache.
Jeremy. (This used to be commit 836b73d0018c3137b7a924b6345e69ae5d23431d)
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r--source3/smbd/statcache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index cfc5286327..99f209006b 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -47,10 +47,15 @@ void stat_cache_add( const char *full_orig_name, const char *orig_translated_pat
TDB_DATA data_val;
char *original_path;
size_t original_path_length;
+ size_t sc_size = lp_max_stat_cache_size();
if (!lp_stat_cache())
return;
+ if (sc_size && (sc_size*1024 > tdb_stat_cache->map_size)) {
+ reset_stat_cache();
+ }
+
ZERO_STRUCT(data_val);
/*