--- zzzz-none-000/linux-2.6.19.2/fs/dcache.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/fs/dcache.c 2007-01-19 14:42:56.000000000 +0000 @@ -478,12 +478,11 @@ up_read(s_umount); } spin_unlock(&dentry->d_lock); - /* - * Insert dentry at the head of the list as inserting at the - * tail leads to a cycle. + /* Cannot remove the first dentry, and it isn't appropriate + * to move it to the head of the list, so give up, and try + * later */ - list_add(&dentry->d_lru, &dentry_unused); - dentry_stat.nr_unused++; + break; } spin_unlock(&dcache_lock); } @@ -557,7 +556,6 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) { struct dentry *parent; - unsigned detached = 0; BUG_ON(!IS_ROOT(dentry)); @@ -622,7 +620,7 @@ atomic_dec(&parent->d_count); list_del(&dentry->d_u.d_child); - detached++; + dentry_stat.nr_dentry--; /* For d_free, below */ inode = dentry->d_inode; if (inode) { @@ -640,7 +638,7 @@ * otherwise we ascend to the parent and move to the * next sibling if there is one */ if (!parent) - goto out; + return; dentry = parent; @@ -649,11 +647,6 @@ dentry = list_entry(dentry->d_subdirs.next, struct dentry, d_u.d_child); } -out: - /* several dentries were freed, need to correct nr_dentry */ - spin_lock(&dcache_lock); - dentry_stat.nr_dentry -= detached; - spin_unlock(&dcache_lock); } /* @@ -1739,7 +1732,7 @@ * * "buflen" should be positive. Caller holds the dcache_lock. */ -static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, +char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, struct dentry *root, struct vfsmount *rootmnt, char *buffer, int buflen) {