summaryrefslogtreecommitdiff
path: root/fs/sdcardfs/dentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sdcardfs/dentry.c')
-rw-r--r--fs/sdcardfs/dentry.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/sdcardfs/dentry.c b/fs/sdcardfs/dentry.c
index 7a19e77fce99..83ae9103a0f6 100644
--- a/fs/sdcardfs/dentry.c
+++ b/fs/sdcardfs/dentry.c
@@ -34,6 +34,8 @@ static int sdcardfs_d_revalidate(struct dentry *dentry, unsigned int flags)
struct dentry *parent_lower_dentry = NULL;
struct dentry *lower_cur_parent_dentry = NULL;
struct dentry *lower_dentry = NULL;
+ struct inode *inode;
+ struct sdcardfs_inode_data *data;
if (flags & LOOKUP_RCU)
return -ECHILD;
@@ -103,6 +105,19 @@ static int sdcardfs_d_revalidate(struct dentry *dentry, unsigned int flags)
spin_unlock(&dentry->d_lock);
spin_unlock(&lower_dentry->d_lock);
}
+ if (!err)
+ goto out;
+
+ /* If our top's inode is gone, we may be out of date */
+ inode = d_inode(dentry);
+ if (inode) {
+ data = top_data_get(SDCARDFS_I(inode));
+ if (data->abandoned) {
+ d_drop(dentry);
+ err = 0;
+ }
+ data_put(data);
+ }
out:
dput(parent_dentry);