Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[cascardo/linux.git] / fs / nfs / dir.c
index 2c3eb33..abdf38d 100644 (file)
@@ -1169,11 +1169,23 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
        iput(inode);
 }
 
+static void nfs_d_release(struct dentry *dentry)
+{
+       /* free cached devname value, if it survived that far */
+       if (unlikely(dentry->d_fsdata)) {
+               if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
+                       WARN_ON(1);
+               else
+                       kfree(dentry->d_fsdata);
+       }
+}
+
 const struct dentry_operations nfs_dentry_operations = {
        .d_revalidate   = nfs_lookup_revalidate,
        .d_delete       = nfs_dentry_delete,
        .d_iput         = nfs_dentry_iput,
        .d_automount    = nfs_d_automount,
+       .d_release      = nfs_d_release,
 };
 
 static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
@@ -1248,6 +1260,7 @@ const struct dentry_operations nfs4_dentry_operations = {
        .d_delete       = nfs_dentry_delete,
        .d_iput         = nfs_dentry_iput,
        .d_automount    = nfs_d_automount,
+       .d_release      = nfs_d_release,
 };
 
 /*