summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-11-18 00:47:05 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-19 02:25:59 -0800
commit0b8b78145b31c12fa4e44e75453531c8a278bc48 (patch)
treea6c12fb8d1264bf07c0de3539ea2121cf1580c6a
parent1f17e87d6ed3a5cbe3f000c923a6280f5713fc0d (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 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;