aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-05-31 12:45:01 -0400
committerTheodore Ts'o <tytso@mit.edu>2023-05-31 12:45:01 -0400
commite76886f76dfca6b9228902cff028b3b7b1ac3131 (patch)
tree4fcb76f3b6a5a88ede0f30e9b0b2b746d26e3cd3
parent24a11cc371a46ca9e68aed8f2cf4aabd22ea81eb (diff)
parent74571d9430da149fa46a0f7ef171920ebe9a7b8c (diff)
downloade2fsprogs-e76886f76dfca6b9228902cff028b3b7b1ac3131.tar.gz
Merge branch 'maint' into next
-rw-r--r--.github/workflows/ci.yml45
-rwxr-xr-xconfigure91
-rw-r--r--configure.ac6
-rw-r--r--e2fsck/iscan.c3
-rw-r--r--e2fsck/pass2.c108
-rw-r--r--e2fsck/util.c3
-rw-r--r--lib/blkid/blkidP.h5
-rw-r--r--lib/config.h.in3
-rw-r--r--lib/support/quotaio.h5
-rw-r--r--misc/e2freefrag.c2
-rw-r--r--tests/f_preen_htree_csum/expect.14
-rw-r--r--tests/f_preen_htree_csum/expect.27
-rw-r--r--tests/f_preen_htree_csum/image.gzbin0 -> 144617 bytes
-rw-r--r--tests/f_preen_htree_csum/name1
-rw-r--r--tests/f_preen_htree_csum/script2
-rw-r--r--tests/r_move_itable_realloc/expect2
-rw-r--r--tests/r_move_itable_realloc/script2
-rw-r--r--tests/u_direct_io/expect2
-rw-r--r--tests/u_direct_io/script6
19 files changed, 205 insertions, 92 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 51b27c88d..0c14250a4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,6 +27,10 @@ jobs:
- run: make -j8 check V=1 CFLAGS_WARN="-Werror"
- run: make -j8 install V=1 DESTDIR=$PWD/installdir
- run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir
+ - uses: actions/upload-artifact@v3
+ with:
+ name: ubuntu-config.h
+ path: lib/config.h
i386-build-and-test:
name: Build and test with gcc -m32
@@ -79,6 +83,10 @@ jobs:
- run: make -j8 check V=1 CFLAGS_WARN="-Werror -Wno-error=deprecated-declarations"
- run: make -j8 install DESTDIR=$PWD/installdir
- run: make -j8 uninstall DESTDIR=$PWD/installdir
+ - uses: actions/upload-artifact@v3
+ with:
+ name: macOS-config.h
+ path: lib/config.h
windows-msys2-build:
name: Build mke2fs on Windows with ${{matrix.sys}}
@@ -114,3 +122,40 @@ jobs:
- run: make -j8 -C misc/ mke2fs V=1 CFLAGS_WARN="-Werror"
- run: touch image.ext4
- run: misc/mke2fs.exe -T ext4 image.ext4 128M
+ - uses: actions/upload-artifact@v3
+ with:
+ name: windows-${{matrix.env}}-config.h
+ path: lib/config.h
+
+ # Jobs that cross-compile e2fsprogs for Android using the Android NDK. Note
+ # that these use the autotools-based build system, which makes them a bit
+ # different from the actual Android builds from the Android source tree.
+ cross-compile-for-android:
+ name: Cross-compile for Android (${{matrix.arch}})
+ strategy:
+ matrix:
+ include:
+ - { arch: aarch64, target: aarch64-linux-android }
+ - { arch: armv7a, target: armv7a-linux-androideabi }
+ - { arch: i686, target: i686-linux-android }
+ - { arch: x86_64, target: x86_64-linux-android }
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ # See https://developer.android.com/ndk/guides/other_build_systems#autoconf
+ - name: configure
+ run: |
+ TOOLCHAIN=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64
+ API_LEVEL=29 # Android 10
+ export AR=$TOOLCHAIN/bin/llvm-ar
+ export CC=$TOOLCHAIN/bin/${{matrix.target}}${API_LEVEL}-clang
+ export AS=$CC
+ export LD=$TOOLCHAIN/bin/ld
+ export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
+ export STRIP=$TOOLCHAIN/bin/llvm-strip
+ ./configure --host=${{matrix.target}} CFLAGS="$DEF_CFLAGS"
+ - run: make -j8 V=1 CFLAGS_WARN="-Werror"
+ - uses: actions/upload-artifact@v3
+ with:
+ name: android-${{matrix.arch}}-config.h
+ path: lib/config.h
diff --git a/configure b/configure
index b0e8d1bf8..72c39b4d3 100755
--- a/configure
+++ b/configure
@@ -8678,7 +8678,7 @@ else $as_nop
*-*-aix*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if defined __powerpc64__ || defined _ARCH_PPC64
+#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
@@ -8969,7 +8969,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
# be generating 64-bit code.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#if defined __powerpc64__ || defined _ARCH_PPC64
+#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
@@ -9076,7 +9076,7 @@ then :
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __ELF__
+#if defined __ELF__ || (defined __linux__ && defined __EDG__)
Extensible Linking Format
#endif
@@ -9094,7 +9094,7 @@ rm -rf conftest*
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5
printf "%s\n" "$gl_cv_elf" >&6; }
- if test $gl_cv_elf; then
+ if test $gl_cv_elf = yes; then
# Extract the ELF class of a file (5th byte) in decimal.
# Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
if od -A x < /dev/null >/dev/null 2>/dev/null; then
@@ -9111,19 +9111,22 @@ printf "%s\n" "$gl_cv_elf" >&6; }
echo
}
fi
+ # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+ # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+ # not 1 or 2.
case $HOST_CPU_C_ABI_32BIT in
yes)
# 32-bit ABI.
acl_is_expected_elfclass ()
{
- test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
}
;;
no)
# 64-bit ABI.
acl_is_expected_elfclass ()
{
- test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
}
;;
*)
@@ -9653,7 +9656,14 @@ fi
fi
;;
-l*)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ dep=`echo "X$dep" | sed -e 's/^X-l//'`
+ if test "X$dep" != Xc \
+ || case $host_os in
+ linux* | gnu* | k*bsd*-gnu) false ;;
+ *) true ;;
+ esac; then
+ names_next_round="$names_next_round $dep"
+ fi
;;
*.la)
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
@@ -10015,8 +10025,9 @@ int
main (void)
{
int result = 0;
- /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
- returns. */
+ /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+ successful returns. This is even documented in
+ <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
@@ -10598,7 +10609,14 @@ fi
fi
;;
-l*)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ dep=`echo "X$dep" | sed -e 's/^X-l//'`
+ if test "X$dep" != Xc \
+ || case $host_os in
+ linux* | gnu* | k*bsd*-gnu) false ;;
+ *) true ;;
+ esac; then
+ names_next_round="$names_next_round $dep"
+ fi
;;
*.la)
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
@@ -12337,6 +12355,15 @@ then :
printf "%s\n" "#define HAVE_LSEEK64_PROTOTYPE 1" >>confdefs.h
fi
+
+ac_fn_check_decl "$LINENO" "fsmap_sizeof" "ac_cv_have_decl_fsmap_sizeof" "#include <linux/fsmap.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fsmap_sizeof" = xyes
+then :
+
+printf "%s\n" "#define HAVE_FSMAP_SIZEOF 1" >>confdefs.h
+
+fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -14776,11 +14803,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
-if test ${ac_cv_prog_cxx_cxx11+y}
+if test ${ac_cv_prog_cxx_11+y}
then :
printf %s "(cached) " >&6
else $as_nop
- ac_cv_prog_cxx_cxx11=no
+ ac_cv_prog_cxx_11=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -14822,11 +14849,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
-if test ${ac_cv_prog_cxx_cxx98+y}
+if test ${ac_cv_prog_cxx_98+y}
then :
printf %s "(cached) " >&6
else $as_nop
- ac_cv_prog_cxx_cxx98=no
+ ac_cv_prog_cxx_98=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -15166,7 +15193,7 @@ fi
if test $pkg_failed = yes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -15175,25 +15202,25 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- udev_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udev" 2>&1`
+ udev_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udev" 2>&1`
else
- udev_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udev" 2>&1`
+ udev_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udev" 2>&1`
fi
- # Put the nasty error message in config.log where it belongs
- echo "$udev_PKG_ERRORS" >&5
+ # Put the nasty error message in config.log where it belongs
+ echo "$udev_PKG_ERRORS" >&5
with_udev_rules_dir=""
elif test $pkg_failed = untried; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
with_udev_rules_dir=""
else
- udev_CFLAGS=$pkg_cv_udev_CFLAGS
- udev_LIBS=$pkg_cv_udev_LIBS
+ udev_CFLAGS=$pkg_cv_udev_CFLAGS
+ udev_LIBS=$pkg_cv_udev_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@@ -15335,7 +15362,7 @@ fi
if test $pkg_failed = yes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -15344,25 +15371,25 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- systemd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd" 2>&1`
+ systemd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd" 2>&1`
else
- systemd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd" 2>&1`
+ systemd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd" 2>&1`
fi
- # Put the nasty error message in config.log where it belongs
- echo "$systemd_PKG_ERRORS" >&5
+ # Put the nasty error message in config.log where it belongs
+ echo "$systemd_PKG_ERRORS" >&5
with_systemd_unit_dir=""
elif test $pkg_failed = untried; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
with_systemd_unit_dir=""
else
- systemd_CFLAGS=$pkg_cv_systemd_CFLAGS
- systemd_LIBS=$pkg_cv_systemd_LIBS
+ systemd_CFLAGS=$pkg_cv_systemd_CFLAGS
+ systemd_LIBS=$pkg_cv_systemd_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@@ -17029,7 +17056,9 @@ printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
- "$presentlang"*) useit=yes;;
+ "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
+ useit=yes
+ ;;
esac
done
if test $useit = yes; then
diff --git a/configure.ac b/configure.ac
index 017a96ffe..b905e9992 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1107,6 +1107,12 @@ AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
[#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <unistd.h>])
+
+dnl The Android NDK has <linux/fsmap.h>, but it is missing the inline functions
+dnl fsmap_sizeof() and fsmap_advance(). Check whether this is the case.
+AC_CHECK_DECL(fsmap_sizeof,[AC_DEFINE(HAVE_FSMAP_SIZEOF, 1,
+ [Define to 1 if fsmap_sizeof() is declared in linux/fsmap.h])],,
+ [#include <linux/fsmap.h>])
dnl
dnl Word sizes...
dnl
diff --git a/e2fsck/iscan.c b/e2fsck/iscan.c
index 33c6a4cdc..1253f52ff 100644
--- a/e2fsck/iscan.c
+++ b/e2fsck/iscan.c
@@ -120,7 +120,8 @@ void print_resource_track(const char *desc,
} else
#elif defined HAVE_MALLINFO
/* don't use mallinfo() if over 2GB used, since it returns "int" */
- if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
+ if ((unsigned long)((char *)sbrk(0) - (char *)track->brk_start) <
+ 2UL << 30) {
struct mallinfo malloc_info = mallinfo();
printf("Memory used: %lluk/%lluk (%lluk/%lluk), ",
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 410edd116..2d5fa9aaf 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -1341,57 +1341,68 @@ skip_checksum:
(rec_len < min_dir_len) ||
((rec_len % 4) != 0) ||
((ext2fs_dir_rec_len(ext2fs_dirent_name_len(dirent),
- extended)) > rec_len)) {
- if (fix_problem(ctx, PR_2_DIR_CORRUPTED,
- &cd->pctx)) {
+ extended)) > rec_len))
+ problem = PR_2_DIR_CORRUPTED;
+ if (problem) {
+ if ((offset == 0) &&
+ (rec_len == fs->blocksize) &&
+ (dirent->inode == 0) &&
+ e2fsck_dir_will_be_rehashed(ctx, ino)) {
+ problem = 0;
+ max_block_size = fs->blocksize;
+ }
+ }
+ if (problem) {
#ifdef WORDS_BIGENDIAN
- /*
- * On big-endian systems, if the dirent
- * swap routine finds a rec_len that it
- * doesn't like, it continues
- * processing the block as if rec_len
- * == EXT2_DIR_ENTRY_HEADER_LEN. This means that the name
- * field gets byte swapped, which means
- * that salvage will not detect the
- * correct name length (unless the name
- * has a length that's an exact
- * multiple of four bytes), and it'll
- * discard the entry (unnecessarily)
- * and the rest of the dirent block.
- * Therefore, swap the rest of the
- * block back to disk order, run
- * salvage, and re-swap anything after
- * the salvaged dirent.
- */
- int need_reswab = 0;
- if (rec_len < EXT2_DIR_ENTRY_HEADER_LEN || rec_len % 4) {
- need_reswab = 1;
- ext2fs_dirent_swab_in2(fs,
- ((char *)dirent) + EXT2_DIR_ENTRY_HEADER_LEN,
- max_block_size - offset - EXT2_DIR_ENTRY_HEADER_LEN,
- 0);
- }
+ int need_reswab = 0;
#endif
- salvage_directory(fs, dirent, prev,
- &offset,
- max_block_size,
- hash_in_dirent);
+
+ if (!fix_problem(ctx, PR_2_DIR_CORRUPTED,
+ &cd->pctx))
+ goto abort_free_dict;
#ifdef WORDS_BIGENDIAN
- if (need_reswab) {
- unsigned int len;
-
- (void) ext2fs_get_rec_len(fs,
- dirent, &len);
- len += offset;
- if (max_block_size > len)
- ext2fs_dirent_swab_in2(fs,
- ((char *)dirent) + len, max_block_size - len, 0);
- }
+ /*
+ * On big-endian systems, if the dirent
+ * swap routine finds a rec_len that it
+ * doesn't like, it continues processing
+ * the block as if rec_len ==
+ * EXT2_DIR_ENTRY_HEADER_LEN. This means
+ * that the name field gets byte swapped,
+ * which means that salvage will not detect
+ * the correct name length (unless the name
+ * has a length that's an exact multiple of
+ * four bytes), and it'll discard the entry
+ * (unnecessarily) and the rest of the
+ * dirent block. Therefore, swap the rest
+ * of the block back to disk order, run
+ * salvage, and re-swap anything after the
+ * salvaged dirent.
+ */
+ if (rec_len < EXT2_DIR_ENTRY_HEADER_LEN ||
+ rec_len % 4) {
+ need_reswab = 1;
+ ext2fs_dirent_swab_in2(fs,
+ ((char *)dirent) + EXT2_DIR_ENTRY_HEADER_LEN,
+ max_block_size - offset - EXT2_DIR_ENTRY_HEADER_LEN, 0);
+ }
#endif
- dir_modified++;
- continue;
- } else
- goto abort_free_dict;
+ salvage_directory(fs, dirent, prev, &offset,
+ max_block_size,
+ hash_in_dirent);
+#ifdef WORDS_BIGENDIAN
+ if (need_reswab) {
+ unsigned int len;
+
+ (void) ext2fs_get_rec_len(fs, dirent,
+ &len);
+ len += offset;
+ if (max_block_size > len)
+ ext2fs_dirent_swab_in2(fs,
+ ((char *)dirent) + len, max_block_size - len, 0);
+ }
+#endif
+ dir_modified++;
+ continue;
}
} else {
if (dot_state == 0) {
@@ -1574,7 +1585,8 @@ skip_checksum:
*/
if (!(ctx->flags & E2F_FLAG_RESTART_LATER) &&
!(ext2fs_test_inode_bitmap2(ctx->inode_used_map,
- dirent->inode)))
+ dirent->inode))
+ )
problem = PR_2_UNUSED_INODE;
if (problem) {
diff --git a/e2fsck/util.c b/e2fsck/util.c
index 42740d9ef..0fe436031 100644
--- a/e2fsck/util.c
+++ b/e2fsck/util.c
@@ -441,7 +441,8 @@ void print_resource_track(e2fsck_t ctx, const char *desc,
} else
#elif defined HAVE_MALLINFO
/* don't use mallinfo() if over 2GB used, since it returns "int" */
- if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
+ if ((unsigned long)((char *)sbrk(0) - (char *)track->brk_start) <
+ 2UL << 30) {
struct mallinfo malloc_info = mallinfo();
log_out(ctx, _("Memory used: %lluk/%lluk (%lluk/%lluk), "),
diff --git a/lib/blkid/blkidP.h b/lib/blkid/blkidP.h
index b3fe4a668..68ea5724f 100644
--- a/lib/blkid/blkidP.h
+++ b/lib/blkid/blkidP.h
@@ -23,9 +23,12 @@
#endif
#include <blkid/blkid.h>
-
#include <blkid/list.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __GNUC__
#define __BLKID_ATTR(x) __attribute__(x)
#else
diff --git a/lib/config.h.in b/lib/config.h.in
index ab38266f6..076c38235 100644
--- a/lib/config.h.in
+++ b/lib/config.h.in
@@ -109,6 +109,9 @@
/* Define to 1 if you have the `fdatasync' function. */
#undef HAVE_FDATASYNC
+/* Define to 1 if fsmap_sizeof() is declared in linux/fsmap.h */
+#undef HAVE_FSMAP_SIZEOF
+
/* Define to 1 if you have the `fstat64' function. */
#undef HAVE_FSTAT64
diff --git a/lib/support/quotaio.h b/lib/support/quotaio.h
index 84fac35dd..390f7dc92 100644
--- a/lib/support/quotaio.h
+++ b/lib/support/quotaio.h
@@ -16,8 +16,7 @@
* AND/OR
* quota_data_add/quota_data_sub/quota_data_inodes();
* }
- * quota_write_inode(qctx, USRQUOTA);
- * quota_write_inode(qctx, GRPQUOTA);
+ * quota_write_inode(qctx, (1 << USRQUOTA) | (1 << GRPQUOTA));
* quota_release_context(&qctx);
* }
*
@@ -223,7 +222,7 @@ void quota_data_add(quota_ctx_t qctx, struct ext2_inode_large *inode,
ext2_ino_t ino, qsize_t space);
void quota_data_sub(quota_ctx_t qctx, struct ext2_inode_large *inode,
ext2_ino_t ino, qsize_t space);
-errcode_t quota_write_inode(quota_ctx_t qctx, enum quota_type qtype);
+errcode_t quota_write_inode(quota_ctx_t qctx, unsigned int qtype_bits);
/* Flags for quota_read_all_dquots() */
#define QREAD_USAGE 0x01
#define QREAD_LIMITS 0x02
diff --git a/misc/e2freefrag.c b/misc/e2freefrag.c
index 49b6346e4..04f155b60 100644
--- a/misc/e2freefrag.c
+++ b/misc/e2freefrag.c
@@ -38,7 +38,7 @@ extern int optind;
#include "e2freefrag.h"
#if defined(HAVE_EXT2_IOCTLS) && !defined(DEBUGFS)
-# ifdef HAVE_LINUX_FSMAP_H
+# if defined(HAVE_LINUX_FSMAP_H) && defined(HAVE_FSMAP_SIZEOF)
# include <linux/fsmap.h>
# endif
# include "fsmap.h"
diff --git a/tests/f_preen_htree_csum/expect.1 b/tests/f_preen_htree_csum/expect.1
new file mode 100644
index 000000000..bbd81944b
--- /dev/null
+++ b/tests/f_preen_htree_csum/expect.1
@@ -0,0 +1,4 @@
+test_filesys: Problem in HTREE directory inode 12: internal node fails checksum.
+HTREE INDEX CLEARED.
+test_filesys: 8204/10000 files (0.0% non-contiguous), 1551/4096 blocks
+Exit status is 1
diff --git a/tests/f_preen_htree_csum/expect.2 b/tests/f_preen_htree_csum/expect.2
new file mode 100644
index 000000000..0730c4a3a
--- /dev/null
+++ b/tests/f_preen_htree_csum/expect.2
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 8204/10000 files (0.0% non-contiguous), 1551/4096 blocks
+Exit status is 0
diff --git a/tests/f_preen_htree_csum/image.gz b/tests/f_preen_htree_csum/image.gz
new file mode 100644
index 000000000..94ce8e142
--- /dev/null
+++ b/tests/f_preen_htree_csum/image.gz
Binary files differ
diff --git a/tests/f_preen_htree_csum/name b/tests/f_preen_htree_csum/name
new file mode 100644
index 000000000..c915eec29
--- /dev/null
+++ b/tests/f_preen_htree_csum/name
@@ -0,0 +1 @@
+fix a bad htree checksum in preen mode
diff --git a/tests/f_preen_htree_csum/script b/tests/f_preen_htree_csum/script
new file mode 100644
index 000000000..23ab8b6aa
--- /dev/null
+++ b/tests/f_preen_htree_csum/script
@@ -0,0 +1,2 @@
+FSCK_OPT=-pf
+. $cmd_dir/run_e2fsck
diff --git a/tests/r_move_itable_realloc/expect b/tests/r_move_itable_realloc/expect
index 67f2fe4a8..8ce56dbc0 100644
--- a/tests/r_move_itable_realloc/expect
+++ b/tests/r_move_itable_realloc/expect
@@ -1,6 +1,6 @@
mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000
resize2fs -p test.img 100000000
-Resizing the filesystem on test.img to 100000000 (1k) blocks.
+Resizing the filesystem on test.img to 99999745 (1k) blocks.
Begin pass 2 (max = 2061)
Relocating blocks ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 125)
diff --git a/tests/r_move_itable_realloc/script b/tests/r_move_itable_realloc/script
index 20c26dbd9..49f8d58a2 100644
--- a/tests/r_move_itable_realloc/script
+++ b/tests/r_move_itable_realloc/script
@@ -1,5 +1,5 @@
os=$(uname -s)
-if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then
+if [ "$os" = "Darwin" -o "$os" = "GNU" -o "$os" = "FreeBSD" ]; then
# creates a 96GB filesystem
echo "$test_name: $test_description: skipped: skipped for $os"
return 0
diff --git a/tests/u_direct_io/expect b/tests/u_direct_io/expect
index 830cbd752..b1511ef10 100644
--- a/tests/u_direct_io/expect
+++ b/tests/u_direct_io/expect
@@ -1,4 +1,4 @@
-mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP
+mke2fs -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP
Creating filesystem with 32768 4k blocks and 32768 inodes
Allocating group tables: done
diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script
index b4f07752c..2f80e6402 100644
--- a/tests/u_direct_io/script
+++ b/tests/u_direct_io/script
@@ -8,14 +8,14 @@ elif test ! -x $DEBUGFS_EXE; then
echo "$test_name: $DESCRIPTION: skipped (no debugfs)"
else
dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1
- LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE)
+ LOOP=$(losetup --show -f $TMPFILE 2>&1)
if [ ! -b "$LOOP" ]; then
echo "$test_name: $DESCRIPTION: skipped (no loop devices)"
rm -f $TMPFILE
exit 0
fi
- echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
- $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
+ echo mke2fs -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
+ $MKE2FS -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
sed -f $cmd_dir/filter.sed >> $OUT
echo debugfs -D -R stats \$LOOP >> $OUT