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
This commit is contained in:
Raghavendra G 2009-11-18 00:29:17 +00:00 committed by Anand V. Avati
parent d14d014782
commit 68a9546e5c

View File

@ -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;