Skip to content

Commit d25cddd

Browse files
committed
fuse: handle directories in fuse_try_prune_one_inode()
When the inode that has to be pruned is a directory call shrink_dcache_parent() before trying to prune. This will try to free all related dcache entries. Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
1 parent 6d6b9c1 commit d25cddd

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

fs/fuse/inode.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ int fuse_reverse_inval_inode(struct fuse_conn *fc, u64 nodeid,
627627

628628
fi->attr_version = atomic64_inc_return(&fc->attr_version);
629629
spin_unlock(&fi->lock);
630-
630+
631631
if (fc->inval_inode_entries)
632632
fuse_invalidate_inode_entry(inode);
633633
else if (fc->expire_inode_entries)
@@ -662,10 +662,20 @@ int fuse_reverse_inval_inode(struct fuse_conn *fc, u64 nodeid,
662662
void fuse_try_prune_one_inode(struct fuse_conn *fc, u64 nodeid)
663663
{
664664
struct inode *inode;
665+
struct dentry *dentry;
665666

666-
inode = fuse_ilookup(fc, nodeid, NULL);
667+
inode = fuse_ilookup(fc, nodeid, NULL);
667668
if (!inode)
668669
return;
670+
671+
if (S_ISDIR(inode->i_mode)) {
672+
dentry = d_find_alias(inode);
673+
if (dentry) {
674+
shrink_dcache_parent(dentry);
675+
dput(dentry);
676+
}
677+
}
678+
669679
d_prune_aliases(inode);
670680
iput(inode);
671681
}

0 commit comments

Comments
 (0)