summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBarry Naujok <bnaujok@sgi.com>2008-06-16 12:07:41 +1000
committerNiv Sardi <xaiki@debian.org>2008-07-28 16:58:47 +1000
commitd532506cd8b59543b376e155508f88a03a81dad1 (patch)
tree554e401cf6bcb9894e0110e05ead0d04d6d0e907 /fs
parent87affd08bc9c741b99053cabb908cf54a135a0fa (diff)
downloadkernel-crypto-d532506cd8b59543b376e155508f88a03a81dad1.tar.gz
kernel-crypto-d532506cd8b59543b376e155508f88a03a81dad1.tar.xz
kernel-crypto-d532506cd8b59543b376e155508f88a03a81dad1.zip
[XFS] Invalidate dentry in unlink/rmdir if in case-insensitive mode
The vfs_unlink/d_delete functionality in the Linux VFS make the dentry negative if it is the only inode being referenced. Case-insensitive mode doesn't work with negative dentries, so if using CI-mode, invalidate the dentry on unlink/rmdir. SGI-PV: 983102 SGI-Modid: xfs-linux-melb:xfs-kern:31308a Signed-off-by: Barry Naujok <bnaujok@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 62330f28395..190ed61bcd4 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -475,6 +475,13 @@ xfs_vn_unlink(
if (likely(!error)) {
xfs_validate_fields(dir); /* size needs update */
xfs_validate_fields(inode);
+ /*
+ * With unlink, the VFS makes the dentry "negative": no inode,
+ * but still hashed. This is incompatible with case-insensitive
+ * mode, so invalidate (unhash) the dentry in CI-mode.
+ */
+ if (xfs_sb_version_hasasciici(&XFS_M(dir->i_sb)->m_sb))
+ d_invalidate(dentry);
}
return -error;
}
@@ -531,6 +538,13 @@ xfs_vn_rmdir(
if (likely(!error)) {
xfs_validate_fields(inode);
xfs_validate_fields(dir);
+ /*
+ * With rmdir, the VFS makes the dentry "negative": no inode,
+ * but still hashed. This is incompatible with case-insensitive
+ * mode, so invalidate (unhash) the dentry in CI-mode.
+ */
+ if (xfs_sb_version_hasasciici(&XFS_M(dir->i_sb)->m_sb))
+ d_invalidate(dentry);
}
return -error;
}