Commit Graph

5346 Commits (c733f9987e26062fcdd77ccda64ed53b87014082)

Author SHA1 Message Date
Darrick J. Wong b04af4fe04 copyin: fix error handling
Save errno (in retval) before doing anything else, because the
"anything else" (usually com_err()) can call library functions, which
will reset errno.

Fix the error messages to use the message catalog, and don't _ever_
print an error without providing context.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:51:02 -04:00
Darrick J. Wong 76f1323491 copy-in: for files, only iterate file blocks that are mapped
Rewrite the file copy-in algorithm to detect smaller holes in the
files we're copying in.  Use SEEK_DATA/SEEK_HOLE/FIEMAP when available
to skip known empty parts.  This fixes the particular bug where zeroed
blocks on a system with 64k pages are needlessly copied into a
4k-block filesystem.  It also saves time by skipping parts we know to
be zeroed.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:46:48 -04:00
Darrick J. Wong a433db04d0 copy-in: create hardlinks with the correct directory filetype
When we're creating hard links via ext2fs_link, the (misnamed?) flags
argument specifies the filetype for the directory entry.  This is
*derived* from i_mode, so provide a translator.  Otherwise, fsck will
complain about unset file types.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:46:06 -04:00
Darrick J. Wong 08b7417b63 tests: test various features of the new e2undo format
Verify that the header, checksum, and wrong-order rollback detection
features of the new e2undo actually work.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:42:34 -04:00
Darrick J. Wong 3af6837095 tests: test undo file creation in e2fsck/resize2fs/tune2fs/mke2fs
Regression tests to ensure that we can create undo files and roll
things back if need be.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:42:19 -04:00
Darrick J. Wong 491cc33ac6 debugfs: optionally create undo file
Provide the user with an option to create an undo file so that they
can roll back a failed debugfs expedition.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:42:04 -04:00
Darrick J. Wong 2d291b3c6b mke2fs: optionally create undo file
Provide the user with an option to create an undo file so that they
can roll back a failed tuning operation.  Previously, one would be
created if force_undo was set in the configuration file and a bunch of
(undocumented) conditions were met.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:41:40 -04:00
Darrick J. Wong f7d055945e tune2fs: optionally create undo file
Provide the user with an option to create an undo file so that they
can roll back a failed tuning operation.  Previously, one would be
created for inode resize if a bunch of (undocumented) conditions were
met.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:41:19 -04:00
Darrick J. Wong 03f9fd2ad9 resize2fs: optionally create undo file
Provide the user with an option to create an undo file so that they
can roll back a failed resize operation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:41:05 -04:00
Darrick J. Wong ce9b74ab4f e2fsck: optionally create an undo file
Provide the user with an option to create an undo file so that they
can roll back a failed repair operation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:40:49 -04:00
Darrick J. Wong dc248a10ca libext2fs: support atexit cleanups
Use the atexit() function to provide a means for the library to clean
itself up on program exit.  This will be used by the undo IO manager
to flush the undo file state to disk if the program should terminate
without closing the io channel, since most e2fsprogs clients will
simply exit() when they hit errors.

This won't help for signal termination; client programs must set
up signal handlers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:40:34 -04:00
Darrick J. Wong 4892bce3c4 e2undo: ditch tdb file, write everything to a flat file
The existing undo file format (which is based on tdb) has many
problems.  First, its comparison of superblock fields is ineffective,
since the last mount time is only written by the kernel, not the tools
(which means that undo files can be applied out of order, thus
corrupting the filesystem); block numbers are written in CPU byte
order, which will cause silent failures if an undo file is moved from
one type of system to another; using the tdb database costs us an
enormous amount of CPU overhead to maintain the key data structure,
and finally, the tdb database is unable to deal with databases larger
than 2GB.  (Upstream tdb 1.2.12 can handle 4GB, but upgrading a 2TB FS
to 64bit,metadata_csum easily produces 2.9GB of undo files, so we
might as well move off of tdb now.)

The last problem is fatal if you want to use tune2fs to turn on
metadata checksumming, since that rewrites every block on the
filesystem, which can easily produce a many-gigabyte undo file, which
of course is unreadable and therefore the operation cannot be undone.

Therefore, rip all of that out in favor of writing to a flat file.
Old blocks are appended to a file and the index is written to the end
when we're done.  This implementation is much faster than wasting a
considerable amount of time trying to maintain a hash index, which
drops the runtime overhead of tune2fs -O metadata_csum from ~45min
to ~20 seconds on a 2TB filesystem.

I have a few reasons that factored in my decision not to repurpose the
jbd2 file format for undo files.  First, undo files are limited to
2^32 blocks (16TB) which some day might not serve us well.  Second,
the journal block size is tied to the file system block size, but
mke2fs wants to be able to back up big chunks of old device contents.
This would require large changes to the e2fsck journal replay code,
which itself is derived from the kernel jbd2 driver, which I'd rather
not destabilize.  Third, I want to require undo files to store the FS
superblock at the end of undo file creation so that e2undo can be
reasonably sure that an undo file is supposed to apply against the
given block device, and doing so would require changes to the jbd2
format.  Fourth, it didn't seem like a good idea that external
journals should resemble undo files so closely.

v2: Provide a state bit that is only set when the undo channel is
closed correctly so we can warn the user about potentially incomplete
undo files.  Straighten out the superblock handling so that undo files
won't be confused for real ext* FS images.  Record multi-block runs in
each block key to reduce overhead even further.  Support reopening an
undo file so that we can combine multiple FS operations into one
(overall smaller) transaction file, which will be easier to manage.
Flush the undo index data if the program should terminate
unexpectedly.  Update the ext4 superblock bits if errors or -f is
found to encourage fsck to do a full run the next time it's invoked.
Enable undoing the undo.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:40:16 -04:00
Darrick J. Wong ec2019d109 e2undo: fix memory leaks and tweak the error messages somewhat
Fix memory leaks and improve the error messages to make it easier
to figure out why e2undo went wrong.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:39:51 -04:00
Darrick J. Wong 3a82e80c55 undo-io: use a bitmap to track what we've already written
It's really inefficient to (ab)use the TDB key store as a bitmap to
find out if we've already written a block to the undo file, because
the tdb code is reads the database key btree disk blocks for *every*
query.  Changing that logic to a bitmap reduces overhead by a large
margin -- the overhead of using undo_io while converting a 2TB FS to
metadata_csum is reduced from 55 minutes to 45.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:39:33 -04:00
Darrick J. Wong 344cd5325b undo-io: be more flexible about setting block size
Most of the e2fsprogs utilities set the IO block size multiple times
(once to 1k to read the superblock, then again to set the real block
size if we find a real superblock).  Unfortunately, the undo IO
manager only lets the block size be set once.  For the non-mke2fs
utilities we'd rather catch the real block size and use that.  mke2fs
of course wants to use a really large block size since it's probably
writing a lot of data.

Therefore, if we haven't written any blocks to the undo file, it's
perfectly fine to allow block size changes.  For mke2fs, we'll modify
the IO channel option that lets us set the huge size to lock that
in place.  This greatly reduces index overhead for undo files for
e2fsck/tune2fs/resize2fs while continuing the practice of reducing
it even more for mke2fs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:39:13 -04:00
Darrick J. Wong c866515f02 undo-io: add new calls to and speed up the undo io manager
Implement pass-through calls for discard, zero-out, and readahead in
the IO manager so that we can take advantage of any underlying
support.

Furthermore, improve tdb write-out speed by disabling locking and only
fsyncing at the end -- we don't care about locking because having
multiple writers to the undo file will produce an undo database full
of garbage blocks; and we only need to fsync at the end because if we
fail before the end, our undo file will lack the necessary superblock
data that e2undo requires to do replay safely.  Without this, we call
fsync four times per tdb update(!)  This reduces the overhead of using
undo_io while converting a 2TB FS to metadata_csum from 3+ hours to 55
minutes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:38:34 -04:00
Theodore Ts'o c46b57bc9d ext2fs: fix "make check" by allowing EXT2FS_SHA256_LENGTH to be defined
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05 10:01:40 -04:00
Theodore Ts'o 437651ad23 Update ext4 encryption format to final v4.1 version
The directory hash is now calculated using the on-disk encrypted
filename, and we no longer use the digest encoding or the SHA-256
encoding, so remove them from the ext2fs library until there is some
reason we need them.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-03 17:01:59 -04:00
Darrick J. Wong 2f79cd18a9 tests: verify rebuilding of sparse extent trees & block map file conversion
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-21 16:23:09 -04:00
Darrick J. Wong e228d700d5 e2fsck: rebuild sparse extent trees & convert non-extent ext3 files
Teach e2fsck to (re)construct extent trees.  This enables us to do
either of the following: compress a highly sparse extent tree into
fewer ETB blocks; or convert a ext3-style block mapped file to an
extent file.  The reconstruction is performed during pass 1E or 3A,
as detailed below.

For files that are already extent based, this algorithm will
automatically run (pending user approval) if pass1 determines either
(1) that a whole level of extent tree will fit into a higher level of
the tree; (2) that the size of any level can be reduced by at least
one ETB block; or (3) the extent tree is unnecessarily deep.  It will
not run at all if errors are found and the user declines to fix the
errors.

The option "-E bmap2extent" can be used to force e2fsck to convert all
block map files to extent trees, and to rebuild all extent files'
extent trees.  After conversion, files larger than 12 blocks should be
defragmented to eliminate empty holes where a block lives.

The extent tree constructor is pretty dumb -- it creates a list of
leaf extents (adjacent extents are collapsed), marks all indirect
blocks / ETB blocks free, installs a new extent tree root in the
inode, then loads the leaf extents into the tree.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-21 16:22:59 -04:00
Darrick J. Wong a5abfe0382 e2fsck: read-ahead metadata during passes 1, 2, and 4
e2fsck pass1 is modified to use the block group data prefetch function
to try to fetch the inode tables into the pagecache before it is
needed.  We iterate through the blockgroups until we have enough inode
tables that need reading such that we can issue readahead; then we sit
and wait until the last inode table block read of the last group to
start fetching the next bunch.

pass2 is modified to use the dirblock prefetching function to prefetch
the list of directory blocks that are assembled in pass1.  We use the
"iterate a subset of a dblist" and avoid copying the dblist.  Directory
blocks are fetched incrementally as we walk through the directory
block list.  In previous iterations of this patch we would free the
directory blocks after processing, but the performance hit to e2fsck
itself wasn't worth it.  Furthermore, it is anticipated that most
users will then mount the FS and start using the directories, so they
may as well remain in the page cache.

pass4 is modified to prefetch the block and inode bitmaps in
anticipation of pass 5, because pass4 is entirely CPU bound.

In general, these mechanisms can decrease fsck time by 10-40%, if the
host system has sufficient memory and the storage system can provide a
lot of IOPs.  Pretty much any storage system capable of handling
multiple IOs in-flight at any time will see a fairly large performance
boost.  (Single-issue USB mass storage disks seem to suffer badly.)

By default, the readahead buffer size will be set to the size of a block
group's inode table (which is 2MiB for a regular ext4 FS).  The -E
readahead_kb= option can be given to specify the amount of memory to
use for readahead or zero to disable it entirely; or an option can be
given in e2fsck.conf.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-21 10:40:21 -04:00
Darrick J. Wong 79614b2709 libext2fs/e2fsck: provide routines to read-ahead metadata
This patch adds to e2fsck the ability to pre-fetch metadata into the
page cache in the hopes of speeding up fsck runs.  There are two new
functions -- the first allows a caller to readahead a list of blocks,
and the second is a helper function that uses that first mechanism to
load group data (bitmaps, inode tables).

These new e2fsck routines require the addition of a dblist API to
allow us to iterate a subset of a dblist.  This will enable
incremental directory block readahead in e2fsck pass 2.

There's also a function to estimate the readahead given a FS.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-21 10:40:15 -04:00
Darrick J. Wong 76761ca221 e2fsck: turn inline data symlink into a fast symlink when possible
When there's a problem accessing the EA part of an inline data symlink
and we want to truncate the symlink back to 60 characters (hoping the
user can re-establish the link later on, apparently) be sure to turn
off the inline data flag to convert the symlink back to a regular fast
symlink.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-20 21:48:02 -04:00
Darrick J. Wong e0d5dd3602 e2fuzz: fuzz harder
Once we've "fixed" the filesystem, try mounting and modifying it to see
if we can break the kernel.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-20 21:47:18 -04:00
Theodore Ts'o a6721909c2 Revert "libext2fs: encrypted symlinks are never fast"
This reverts commit ae73e88e82.

The latest kernel patches will now create fast encrypted symlinks

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-12 18:05:07 -04:00
Theodore Ts'o fc898cb99b Reserve superblock fields s_lpf_ino and s_encryption_level
The s_lpf_ino field is intended to store the location of the lost and
found directory if the root directory becomes encrypted (which is not
yet supported).  The s_encryption_level field is designed to allow
support for future changes in the on-disk ext4 encryption format while
this feature under development, without having to burn a large number
of bits in the incompat feature flag.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-12 08:51:53 -04:00
Theodore Ts'o 4a05268cf8 Remove compression support
The compression patches were an out-of-kernel patch set that was (a)
only available for ext2, (b) something that was never could be
stablized due to file system corruption, and (c) the most recent
patches were for 3.1, last updated in 2011.

The history of the compression patches has been a bit checkered.
There is a long history here at http://e2compr.sourceforge.net which
lists the perspective of the people working on it from the e2compr
side.

From the ext2/3/4 mainline developers' perspective, initial
compression support was added to e2fsprogs in 2000 (in the Linux 2.2
era), but due to stability concerns the kernel patches were never
merged into the mainline kernel.  While there were some sporadic
efforts to try to get the ext2 compression patches working in the 2.4
and 2.6 era, by that time mainline work had moved on to ext4, and the
e2compr approach could only work with 32-bit block numbers and
indirect mapped files.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-12 08:42:40 -04:00
Theodore Ts'o 8dbcedd702 Merge branch 'maint' into next 2015-04-05 20:44:39 -04:00
Theodore Ts'o a0556bd8e1 e4crypt: add the get_policy command
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-05 20:43:24 -04:00
Theodore Ts'o 654531df2a tune2fs: add ability to enable the encrypt feature
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-05 20:42:58 -04:00
Theodore Ts'o f7257a93f9 Change filename encryption to use CTS mode
Previously we were using a weird hybrid CBC/CTS.  Switch things so we
are using straight CTS; this corresponds to changes made in the latest
ext4 encryption patches.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-05 20:39:57 -04:00
Theodore Ts'o 8afaf3be33 libext2fs: fix bug in ext2fs_digest_encode()
The ext2fs_digest_encode() function was broken for any input which was
a multiple of 3.  Previously we never hit that case, so we never
noticed it was busted.  Also fix up the unit test so future problems
like this get noticed quickly.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-05 20:35:50 -04:00
Theodore Ts'o 4fb758aa4b Clean up and fix Android build files
Add missing new lib/ext2fs source files that were added for encryption
support.  Also move configuration #define's from individual Android.mk
to the android_config.h file, since we've moved away from specifying
configuration #define's on the command-line upstream.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-30 14:50:55 -04:00
Theodore Ts'o 8b5c6c78d5 Update version.h
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-30 02:13:09 -04:00
Theodore Ts'o 1e734e72e1 e4crypt: change the UI to use a subcommand style
Also add a new subcommand "new_session", which works much like keyctl
new_session does.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-30 02:13:09 -04:00
Darrick J. Wong ce93d0ea3d libext2fs: zero hash in ibody extended attributes
The kernel never updates the extended attribute hash value for
attributes stored in the inode.  However, fsck has always checked this
value (if it's nonzero) and will complain if the hash doesn't match
the xattr.  Therefore, always zero the hash value when writing to
in-ibody xattrs to avoid creating "corrupt" attribute errors
downstream.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-29 00:12:53 -04:00
Darrick J. Wong dbb328576d e2fsck: actually fix inline_data flags problems when user says to do so
fix_problem() returning 1 means to fix the fs error, so do that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-29 00:04:46 -04:00
Darrick J. Wong fae2467fb6 libext2fs: ext2fs_new_block2() should call alloc_block hook
If ext2fs_new_block2() is called without a specific block map, we
should call the alloc_block hook before checking fs->block_map.  This
helps us to avoid a bug in e2fsck where we need to allocate a block
but instead of consulting block_found_map, we use the FS bitmaps,
which (prior to pass 5) could be wrong.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-28 23:58:20 -04:00
Darrick J. Wong 3d28f54589 libext2fs: zero blocks via FALLOC_FL_ZERO_RANGE in ext2fs_zero_blocks
Plumb a new call into the IO manager to support translating
ext2fs_zero_blocks calls into the equivalent FALLOC_FL_ZERO_RANGE
fallocate flag primitive when possible.  This patch provides _only_
support for file-based images.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-28 23:08:25 -04:00
Theodore Ts'o f096708126 e2fsck: use PROMPT_NONE for FUTURE_SB_LAST_*_FUDGED problems
This allows us to print a message warning the user that there is
something funny going on with their hardware clock (probably time zone
issues caused by trying to be compatible with legacy OS's such as
Windows), without triggering a full file system check.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-28 21:39:54 -04:00
Theodore Ts'o 41f2210131 Add support for a password salt stored in the superblock
Previously, e4crypt required the user to manually specify the salt
used for their passphrase.  This was user unfriendly to say the least.
The e4crypt program can now request the salt using an ioctl, which
will automatically generate the salt if necessary, and keep it in the
ext4 superblock.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-28 20:15:02 -04:00
Ildar Muslukhov bfa4b350b1 misc: add e4crypt tool
This patch adds new e4crypt tool for encryption management in the ext4
filesystem.

Signed-off-by: Ildar Muslukhov <muslukhovi@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-26 09:30:03 -04:00
Theodore Ts'o c4241cf50a libext2fs: fix blocksize for SHA512
The blocksize of SHA512 is 128 bytes, not 512.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-26 00:17:48 -04:00
Ildar Muslukhov bbb859496a misc: teach mke2fs to create encrypted file systems
Also enable support for encryption in e2fsprogs.

Signed-off-by: Ildar Muslukhov <muslukhovi@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-08 23:29:04 -04:00
Theodore Ts'o 62ad24802c e2fsck: handle encrypted directories which are indexed using htree
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-08 19:09:52 -04:00
Theodore Ts'o 6a5bdaf73d libext2fs: fix up ext2fs_sha256() and ext2fs_sha512()
Add const annotation to the input pointers; also run the tst_sha256
and tst_sha512 unit tests on a "make check".

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-08 18:19:05 -04:00
Theodore Ts'o bf34b4af70 libext2fs: add ext2fs_digest_encode()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-08 18:15:47 -04:00
Theodore Ts'o 68a1de3df3 debugfs: pretty print encrypted filenames in the ls command
Added the -r (raw) option to print the actual encrypted entry.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-08 18:04:04 -04:00
Theodore Ts'o baa14bd17f e2fsck: fix spurious duplicate directory entries with encrypted filenames
Use memcmp() instead of strncmp() since encrypted directory names can
contain NUL characters.  For non-encrypted directories, we've already
checked for the case of NUL characters in file names, so it's safe to
use memcmp() here in all cases.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-02 11:40:18 -05:00
Theodore Ts'o ae73e88e82 libext2fs: encrypted symlinks are never fast
Teach ext2fs_inodes_has_valid_blocks2() that encrypted symlinks always
use an external block (i.e., we never try to store the symlink in the
i_blocks[] array if it is encrypted).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-03-01 16:58:46 -05:00