aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2013-09-07 02:45:51 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2013-09-07 02:45:51 +0000
commit1f7c9f2bc87074e209647d2f2a477adc107854bd (patch)
tree3cd7fb2943381405bd390972131945a2a1ed6a24
parentd4d23375d3a0ec3669fb09bdfc0f6bd477d43c6e (diff)
ext2fs: temporarily disable htree directory index.
Our code does not consider yet the case of hash collisions. This is a rather annoying situation where two or more files that happen to have the same hash value will not appear accessible. The situation is not difficult to work-around but given that things will just work without enabling htree we will save possible embarrassments for the next release. Reported by: Kevin Lo
Notes
svn path=/head/; revision=255338
-rw-r--r--sys/fs/ext2fs/ext2_htree.c2
-rw-r--r--sys/fs/ext2fs/ext2_lookup.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/ext2fs/ext2_htree.c b/sys/fs/ext2fs/ext2_htree.c
index 0b5d9205b61a..ff1e1a5ef61e 100644
--- a/sys/fs/ext2fs/ext2_htree.c
+++ b/sys/fs/ext2fs/ext2_htree.c
@@ -89,10 +89,12 @@ static int ext2_htree_writebuf(struct ext2fs_htree_lookup_info *info);
int
ext2_htree_has_idx(struct inode *ip)
{
+#ifdef EXT2FS_HTREE
if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) &&
ip->i_flags & EXT4_INDEX)
return (1);
else
+#endif
return (0);
}
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
index 990ed330217f..d6075542fa8d 100644
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -884,6 +884,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp)
bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1);
newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen);
+#ifdef EXT2FS_HTREE
if (ext2_htree_has_idx(dp)) {
error = ext2_htree_add_entry(dvp, &newdir, cnp);
if (error) {
@@ -904,6 +905,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp)
return ext2_htree_create_index(dvp, cnp, &newdir);
}
}
+#endif /* EXT2FS_HTREE */
if (dp->i_count == 0) {
/*