summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-11-18 00:29:17 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-19 01:15:43 -0800
commit68a9546e5ce01e6fefc8ae97d5d7e27da1f6d52a (patch)
treea8243af5ad04cf2f0aa6194477e85939bbddb499
parentd14d014782dd4d7023f99a054d0c4db37d020435 (diff)
performance/stat-prefetch: don't cache dentries corresponding to directory.
- distribute picks up the inode number from hashed subvolume. But readdir is done from different subvolumes based on the offset. Hence there is a possibility of inode number and device number for directories being inconsistent between two stat calls. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 371 (rm -rf fails on stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=371
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index fdf4b74240b..60a77f9a2ea 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -476,6 +476,10 @@ sp_cache_add_entries (sp_cache_t *cache, gf_dirent_t *entries)
LOCK (&cache->lock);
{
list_for_each_entry (entry, &entries->list, list) {
+ if (S_ISDIR (entry->d_stat.st_mode)) {
+ continue;
+ }
+
new = gf_dirent_for_name (entry->d_name);
if (new == NULL) {
goto unlock;