History log of /freebsd-current/sys/fs/ext2fs/ext2_htree.c
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 284cf3f1 30-May-2021 Mateusz Guzik <mjg@FreeBSD.org>

ext2: add missing uio_td initialization to ext2_htree_append_block

Reported by: pho


# cd3acfe7 17-May-2020 Fedor Uporov <fsu@FreeBSD.org>

Add BE architectures support.

Author of most initial version: pfg (https://reviews.freebsd.org/D23259)

Reviewed by: pfg
MFC after: 3 months

Differential Revision: https://reviews.freebsd.org/D24685


# ebc94b66 16-Apr-2019 Fedor Uporov <fsu@FreeBSD.org>

ext2fs: Initial version of DTrace support.

Reviewed by: pfg, gnn
MFC after: 1 week

Differential Revision: https://reviews.freebsd.org/D19848


# 17c7b27f 07-Aug-2018 Fedor Uporov <fsu@FreeBSD.org>

Fix directory blocks checksum updating logic.

The checksum updating functions were not called in case of dir index inode splitting
and in case of dir entry removing, when the entry was first in the block.
Fix and move the dir entry adding logic when i_count == 0 to new function.

MFC after: 3 months


# 6d4a4ed7 13-May-2018 Fedor Uporov <fsu@FreeBSD.org>

Fix directory blocks checksumming.

Reviewed by: pfg
MFC after: 3 months

Differential Revision: https://reviews.freebsd.org/D15396


# e06e5241 13-May-2018 Fedor Uporov <fsu@FreeBSD.org>

Fix EXT2FS_DEBUG definition usage.

Reviewed by: pfg
MFC after: 3 months

Differential Revision: https://reviews.freebsd.org/D15394


# d63027b6 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/fs: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# b6244572 17-Feb-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: Remove unused assignment.

Value is re-assigned a few lines later without being read.

Found by: Clang static analyzer
MFC after: 1 week


# bf9a211d 28-Dec-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

style(9) cleanups.

Just to reduce some of the issues found with indent(1).

MFC after: 1 week


# 4cb92c4c 23-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2_htree_release(): prevent signed integer overflow in a loop.

h_levels_num, as most data structs in ext2fs, is unsigned so
the index that addresses it has to be unsigned as well.

To get to overflow here we would probably be considering a
degenerate case though.

MFC after: 5 days


# 9b58c801 23-Jan-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Rename some directory index constants.

Directory index was introduced in ext3. We don't always use the
prefix to denote the ext2 variant they belong to but when we
do we should try to be accurate.


# 9824e4ad 21-Jan-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: Bring back the htree dir_index implementation.

The htree dir_index is perhaps one of the most characteristic
features of the linux ext3 implementation. It was removed
in r281670, due to repeated bug reports.

Damjan Jovanic detected and fixed three bugs and did some
stress testing by building Apache OpenOffice on top of it
so it is now in good shape to bring back.

Differential Revision: https://reviews.freebsd.org/D5007

Submitted by: Damjan Jovanovic
Reviewed by: pfg
Tested by: pho
Relnotes: Yes
MFC after: 2 months (only 10.x)


# f738ee48 17-Apr-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

Drop experimental dir_index support.

The htree directory index is a highly desirable feature for research
purposes and was meant to improve performance in our ext2/3 driver.
Unfortunately our implementation has two problems:

- It never really delivered any performance improvement.
- It appears to corrupt the filesystem in undetermined circumstances.

Strictly speaking dir_index is not required for read/write support in
ext2/3 and our limited ext4 support still works fine without it.

Regain stability in the ext2 driver by removing it. We may need it back
(fixed) if we want to support encrypted ext4 support but thanks to the
wonders of version control we can always revert this change and bring it
back.

PR: 191895
PR: 198731
PR: 199309

MFC after: 5 days


# 6be4cf22 14-Feb-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

Reuse value of cursize instead of recalculating.

Reported by: Clang static checker
MFC after: 1 week


# 9a53618a 18-Jan-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2: Garbage-collect some unused variables

Reported by: clang static analysis
MFC after: 2 weeks


# 157b40af 06-Mar-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: Fix a bug when sorting htree entries.

This a typo introduced when bringing the original code from NetBSD.

Reported by: Mike Ma
MFC after: 3 days


# 3a54024d 28-Feb-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: use of tab vs spaces.

Consistently use a single tab after a #define as mentioned in style(9).
Use tabs instead of space for indenting.
Fix a typo: "hash_vesion".

No functional change.

MFC after: 3 days


# ad3d96a7 28-Jan-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: Use i_flag instead of i_flags for Ext4 inode flags.

The ext4 inode flags do not have equivalents for chflags (1)
and hold information that is private to the implementation.
The i_flag field in the inode is a better place to hold the Ext4
inode flags as it saves us from masking flags while setting or
getting attributes. It should also make things cleaner if we
implement write support for Ext4.

Suggested by: bde
Tested by: Mike Ma
MFC after: 3 days


# 1093104c 24-Jan-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: fix a bug in dirindex and re-enable.

The IN_* flags should be set in i_flag instead of corrupting
i_flags [1].

Re-enable HTree dirindex as the last series of bug fixes
seems to have fixed the issues.

Reported by: bde [1]
Tested by: kevlo
MFC after: 1 week


# a7710d51 21-Jan-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

ext2fs: Translate the EXT4_EXTENTS and EXT4_INDEX to the inode flags.

r260545 cleared the inode flags to fix corruption problems but
we still need to pass some EXT4 flags for the ext4 read-only
mode. None of these attributes has an equivalent in FreeBSD and
are uninteresting for the system utilities so they should be
innaccessible in ext2_getattrib().

Note: we also use EXT4_HUGE_FILE but we use it directly from the
dinode structure so it is not necessary to translate it,

Suggested by: bde
MFC after: 3 days


# 1f7c9f2b 06-Sep-2013 Pedro F. Giffuni <pfg@FreeBSD.org>

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


# d66aed2e 06-Jul-2013 Pedro F. Giffuni <pfg@FreeBSD.org>

Fix some typos.

MFC after: 1 week


# 91f5a467 06-Jul-2013 Pedro F. Giffuni <pfg@FreeBSD.org>

Initial implementation of the HTree directory index.

This is a port of NetBSD's GSoC 2012 Ext3 HTree directory indexing
by Vyacheslav Matyushin. It was cleaned up and enhanced for FreeBSD
by Zheng Liu (lz@).

This is an excellent example of work shared among different projects:
Vyacheslav was able to look at an early prototype from Zheng Liu who
was also able to check the code from Haiku (with permission).

As in linux, the feature is not available by default and must be
enabled explicitly with tune2fs. We still do not support the
workarounds required in readdir for NFS.

Submitted by: Zheng Liu
Tested by: Mike Ma
Sponsored by: Google Inc.
MFC after: 1 week