summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-09-06 01:37:14 +0000
committerAndrew Tridgell <tridge@samba.org>1998-09-06 01:37:14 +0000
commit4fc5a74ffa491d52afc373abcdd4257a4f105aa4 (patch)
treec6eb9af27052997cfc8c49a2c23f637cc30314b2 /source3/smbd
parentfd33412fa0ebd7de6c8749caeb111bdf4390dd47 (diff)
downloadsamba-4fc5a74ffa491d52afc373abcdd4257a4f105aa4.tar.gz
samba-4fc5a74ffa491d52afc373abcdd4257a4f105aa4.tar.bz2
samba-4fc5a74ffa491d52afc373abcdd4257a4f105aa4.zip
add a "stat cache" boolean smb.conf option. (defaults to on)
I think we need this so we can rule out stat cache bugs when dealing with bug reports. If we ask a user to disable the stat cache and the problem persists then we know it isn't a stat cache bug. The stat cache code is sufficiently complicated that it can be pretty hard to tell if it is causing problems or not. (This used to be commit c83f3775cd8a7aad13571926cdd5949a07538771)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/filename.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index ee9ce3f835..a88829de9d 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -150,7 +150,11 @@ static void stat_cache_add( char *full_orig_name, char *orig_translated_path)
stat_cache_entry *scp;
pstring orig_name;
pstring translated_path;
- int namelen = strlen(orig_translated_path);
+ int namelen;
+
+ if (!lp_stat_cache()) return;
+
+ namelen = strlen(orig_translated_path);
/*
* Don't cache trivial valid directory entries.
@@ -235,8 +239,12 @@ static BOOL stat_cache_lookup( char *name, char *dirpath, char **start, SMB_STRU
{
stat_cache_entry *scp;
stat_cache_entry *longest_hit = NULL;
- int namelen = strlen(name);
+ int namelen;
+
+ if (!lp_stat_cache()) return False;
+ namelen = strlen(name);
+
*start = name;
global_stat_cache_lookups++;