From 0b8b78145b31c12fa4e44e75453531c8a278bc48 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 18 Nov 2009 00:47:05 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 371 (rm -rf fails on stat-prefetch.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=371 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/performance/stat-prefetch') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 5062dc184..2261b8948 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -473,6 +473,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; -- cgit