Merge branch 'maint' into next

Conflicts:
	debugfs/set_fields.c
	tests/f_mmp/script
	tests/f_mmp_garbage/script
	tests/m_mmp/script
	tests/t_mmp_1on/script
	tests/t_mmp_2off/script
This commit is contained in:
Theodore Ts'o 2014-07-06 00:09:27 -04:00
commit 7f7d1cb462
99 changed files with 27788 additions and 9394 deletions

10
.gitignore vendored
View File

@ -51,6 +51,12 @@ e2fsck/tst_problem
e2fsck/tst_refcount
e2fsck/tst_region
e2fsprogs.spec
intl/charset.alias
intl/libgnuintl.h
intl/libintl.a
intl/libintl.h
intl/ref-add.sed
intl/ref-del.sed
lib/blkid/blkid.h
lib/blkid/blkid.pc
lib/blkid/blkid_types.h
@ -84,11 +90,13 @@ lib/et/compile_et
lib/et/libcom_err.a
lib/et/subdirs
lib/ext2fs/crc32c_table.h
lib/ext2fs/debug_cmds.c
lib/ext2fs/ext2_err.c
lib/ext2fs/ext2_err.et
lib/ext2fs/ext2_err.h
lib/ext2fs/ext2_types.h
lib/ext2fs/ext2fs.pc
lib/ext2fs/extent_cmds.c
lib/ext2fs/gen_crc32ctable
lib/ext2fs/libext2fs.a
lib/ext2fs/subdirs
@ -97,12 +105,14 @@ lib/ext2fs/tst_bitmaps
lib/ext2fs/tst_bitmaps_cmd.c
lib/ext2fs/tst_bitmaps_out
lib/ext2fs/tst_bitops
lib/ext2fs/tst_cmds.c
lib/ext2fs/tst_csum
lib/ext2fs/tst_crc32c
lib/ext2fs/tst_icount
lib/ext2fs/tst_inline
lib/ext2fs/tst_inode_size
lib/ext2fs/tst_iscan
lib/ext2fs/tst_libext2fs
lib/ext2fs/tst_super_size
lib/ext2fs/tst_types
lib/libblkid.a

View File

@ -73,7 +73,7 @@ pkgconfigdir = $(libdir)/pkgconfig
CC = @CC@
BUILD_CC = @BUILD_CC@
CFLAGS = @CFLAGS@
CFLAGS = @CFLAGS@ @DEFS@
CPPFLAGS = @INCLUDES@
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
LDFLAGS = @LDFLAGS@
@ -230,8 +230,9 @@ MANMODE= 444
DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.library \
$(top_srcdir)/lib/Makefile.elf-lib \
$(top_srcdir)/lib/Makefile.bsd-lib $(top_srcdir)/lib/Makefile.darwin-lib \
$(top_srcdir)/lib/Makefile.solaris-lib $(top_srcdir)/lib/Makefile.checker \
$(top_srcdir)/lib/Makefile.bsd-lib \
$(top_srcdir)/lib/Makefile.darwin-lib \
$(top_srcdir)/lib/Makefile.solaris-lib \
$(top_srcdir)/lib/Makefile.profile
$(top_builddir)/config.status: $(top_srcdir)/configure

130
acinclude.m4 Normal file
View File

@ -0,0 +1,130 @@
# from http://autoconf-archive.cryp.to/ax_tls.html
#
# This was licensed under the GPL with the following exception:
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you make
# and distribute a modified version of the Autoconf Macro, you may
# extend this special exception to the GPL to apply to your modified
# version as well.
#
AC_DEFUN([AX_TLS], [
AC_MSG_CHECKING(for thread local storage (TLS) class)
AC_CACHE_VAL(ac_cv_tls, [
ax_tls_keywords="__thread __declspec(thread) none"
for ax_tls_keyword in $ax_tls_keywords; do
case $ax_tls_keyword in
none) ac_cv_tls=none ; break ;;
*)
AC_TRY_COMPILE(
[#include <stdlib.h>
static void
foo(void) {
static ] $ax_tls_keyword [ int bar;
exit(1);
}],
[],
[ac_cv_tls=$ax_tls_keyword ; break],
ac_cv_tls=none
)
esac
done
])
if test "$ac_cv_tls" != "none"; then
dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
fi
AC_MSG_RESULT($ac_cv_tls)
])
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/check_gnu_make.html
# ===========================================================================
#
# SYNOPSIS
#
# CHECK_GNU_MAKE()
#
# DESCRIPTION
#
# This macro searches for a GNU version of make. If a match is found, the
# makefile variable `ifGNUmake' is set to the empty string, otherwise it
# is set to "#". This is useful for including a special features in a
# Makefile, which cannot be handled by other versions of make. The
# variable _cv_gnu_make_command is set to the command to invoke GNU make
# if it exists, the empty string otherwise.
#
# Here is an example of its use:
#
# Makefile.in might contain:
#
# # A failsafe way of putting a dependency rule into a makefile
# $(DEPEND):
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
#
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
# @ifGNUmake@ include $(DEPEND)
# @ifGNUmake@ endif
#
# Then configure.in would normally contain:
#
# CHECK_GNU_MAKE()
# AC_OUTPUT(Makefile)
#
# Then perhaps to cause gnu make to override any other make, we could do
# something like this (note that GNU make always looks for GNUmakefile
# first):
#
# if ! test x$_cv_gnu_make_command = x ; then
# mv Makefile GNUmakefile
# echo .DEFAULT: > Makefile ;
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
# fi
#
# Then, if any (well almost any) other make is called, and GNU make also
# exists, then the other make wraps the GNU make.
#
# LICENSE
#
# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
#
# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
AC_DEFUN(
[CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
_cv_gnu_make_command='' ;
dnl Search all the common names for GNU make
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
_cv_gnu_make_command=$a ;
break;
fi
done ;
) ;
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
if test "x$_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
ifNotGNUmake='#' ;
else
ifGNUmake='#' ;
ifNotGNUmake='' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
AC_SUBST(ifNotGNUmake)
] )

3695
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

164
config/config.guess vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2013-11-29'
timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
@ -826,7 +826,7 @@ EOF
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
@ -969,10 +969,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*)
or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
@ -1371,154 +1371,6 @@ EOF
exit ;;
esac
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 <<EOF
$0: unable to guess system type

View File

@ -2,28 +2,13 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2002 Free Software Foundation, Inc.
# Copyright 1996-2013 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
@ -34,66 +19,137 @@
#
# The set of defined variables is at the end of this script.
# All known linkers require a `.a' archive for static linking (except M$VC,
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shlibext=
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix3* | aix4* | aix5*)
aix*)
wl='-Wl,'
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6*)
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
linux*)
echo '__INTEL_COMPILER' > conftest.$ac_ext
if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
then
:
else
# Intel icc
wl='-Qoption,ld,'
fi
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
xl* | bgxl* | bgf* | mpixl*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
wl=
;;
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,'
;;
esac
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
if test "x$host_vendor" = xsni; then
wl='-LD'
else
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
fi
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@ -101,6 +157,10 @@ case "$host_os" in
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
@ -108,56 +168,97 @@ esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX, the GNU linker is very broken
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we can use
# them.
ld_shlibs=no
;;
esac
;;
beos*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
;;
solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
haiku*)
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
@ -171,7 +272,7 @@ else
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@ -181,13 +282,14 @@ else
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
@ -199,7 +301,7 @@ else
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
:
else
# We have old collect2
hardcode_direct=unsupported
@ -207,25 +309,46 @@ else
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
cygwin* | mingw* | pw32*)
esac
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@ -234,10 +357,15 @@ else
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=yes
;;
freebsd1*)
hardcode_direct=no
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
@ -247,18 +375,46 @@ else
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd*)
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9* | hpux10* | hpux11*)
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_minus_L=yes # Not in the search PATH, but as the default
# location of the library.
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
irix5* | irix6*)
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@ -271,7 +427,10 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@ -285,6 +444,9 @@ else
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
@ -303,8 +465,6 @@ else
fi
hardcode_libdir_separator=:
;;
sco3.2v5*)
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
@ -314,33 +474,33 @@ else
hardcode_minus_L=yes
;;
sysv4)
if test "x$host_vendor" = xsno; then
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
else
hardcode_direct=no # Motorola manual says yes, but my tests say they lie
fi
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv5*)
hardcode_libdir_flag_spec=
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4.2uw2*)
hardcode_direct=yes
hardcode_minus_L=no
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5uw7* | unixware7*)
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
@ -349,136 +509,153 @@ else
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
case "$host_os" in
aix3*)
shlibext=so
library_names_spec='$libname.a'
;;
aix4* | aix5*)
shlibext=so
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
shlibext=ixlibrary
;;
beos*)
shlibext=so
;;
bsdi4*)
shlibext=so
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
;;
cygwin* | mingw* | pw32*)
case $GCC,$host_os in
yes,cygwin*)
shlibext=dll.a
;;
yes,mingw*)
shlibext=dll
sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
;;
yes,pw32*)
shlibext=dll
;;
*)
shlibext=dll
;;
case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shlibext=dylib
shrext=.dylib
library_names_spec='$libname$shrext'
;;
freebsd1*)
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd*)
shlibext=so
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
shlibext=so
library_names_spec='$libname$shrext'
;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
shlibext=sl
case $host_cpu in
ia64*)
shrext=.so
;;
irix5* | irix6*)
shlibext=so
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5*)
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 ") libsuff= shlibsuff= ;;
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
;;
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
linux*oldld* | linux*aout* | linux*coff*)
;;
linux-gnu*)
shlibext=so
linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
shlibext=so
library_names_spec='$libname$shrext'
;;
newsos6)
shlibext=so
library_names_spec='$libname$shrext'
;;
*nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
shlibext=so
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shlibext=dll
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
shlibext=so
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
library_names_spec='$libname$shrext'
;;
sco3.2v5*)
shlibext=so
rdos*)
;;
solaris*)
shlibext=so
library_names_spec='$libname$shrext'
;;
sunos4*)
shlibext=so
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
shlibext=so
case "$host_vendor" in
motorola)
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
uts4*)
shlibext=so
;;
dgux*)
shlibext=so
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
if test -d /usr/nec; then
shlibext=so
fi
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
@ -489,6 +666,12 @@ libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
@ -504,10 +687,4 @@ hardcode_direct="$hardcode_direct"
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
# Compile-time system search path for libraries
sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
EOF

19
config/config.sub vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2013-10-01'
timestamp='2014-05-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -283,8 +283,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
@ -296,8 +298,7 @@ case $basic_machine in
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
| or1k | or32 \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@ -402,8 +403,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
@ -415,6 +418,7 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@ -1376,7 +1380,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1594,9 +1598,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
or1k-*)
os=-elf
;;
or32-*)
os=-coff
;;

5367
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -124,6 +124,7 @@ then
else
AC_MSG_RESULT([[(none)]])
fi
AC_USE_SYSTEM_EXTENSIONS
dnl
dnl Set default values for library extentions. Will be dealt with after
dnl parsing configuration opions, which may modify these
@ -392,28 +393,7 @@ then
AC_MSG_RESULT([Enabling gcov support])
fi
)
dnl
dnl handle --enable-checker
dnl
AC_ARG_ENABLE([checker],
[ --enable-checker build checker libraries],
if test "$enableval" = "no"
then
CHECKER_CMT=#
MAKEFILE_CHECKER=/dev/null
AC_MSG_RESULT([Disabling checker libraries])
else
CHECKER_CMT=
MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
AC_MSG_RESULT([Building checker libraries])
fi
,
CHECKER_CMT=#
MAKEFILE_CHECKER=/dev/null
AC_MSG_RESULT([Disabling checker libraries by default])
)
AC_SUBST(CHECKER_CMT)
AC_SUBST_FILE(MAKEFILE_CHECKER)
dnl
dnl Substitute library extensions
dnl
@ -498,8 +478,7 @@ then
AC_CHECK_LIB(uuid, uuid_generate,
[LIBUUID=`$PKG_CONFIG --libs uuid`;
STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
[AC_MSG_ERROR([external uuid library not found])],
[$LIBUUID])
[AC_MSG_ERROR([external uuid library not found])])
UUID_CMT=#
AC_MSG_RESULT([Disabling private uuid library])
else
@ -550,8 +529,7 @@ then
AC_CHECK_LIB(blkid, blkid_get_cache,
[LIBBLKID=`$PKG_CONFIG --libs blkid`;
STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
[AC_MSG_ERROR([external blkid library not found])],
[$LIBBLKID])
[AC_MSG_ERROR([external blkid library not found])], -luuid)
BLKID_CMT=#
AC_MSG_RESULT([Disabling private blkid library])
else
@ -949,12 +927,13 @@ AC_CHECK_HEADERS(m4_flatten([
net/if_dl.h
netinet/in.h
sys/disklabel.h
sys/disk.h
sys/file.h
sys/ioctl.h
sys/mkdev.h
sys/mman.h
sys/mount.h
sys/prctl.h
sys/queue.h
sys/resource.h
sys/select.h
sys/socket.h
@ -967,12 +946,6 @@ AC_CHECK_HEADERS(m4_flatten([
sys/un.h
sys/wait.h
]))
AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
[[
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#endif
]])
AC_CHECK_HEADERS(net/if.h,,,
[[
#if HAVE_SYS_TYPES_H

View File

@ -23,7 +23,7 @@ VOLUME=root
SNAPSIZE=100m
EMAIL=sysadmin@example.com
TMPFILE=`mktemp -t e2fsck.log.XXXXXXXXXX`
TMPFILE=`mktemp ${TMPDIR:-/tmp}/e2fsck.log.XXXXXXXXXX`
OPTS="-Fttv -C0"
#OPTS="-Fttv -E fragcheck"

View File

@ -115,6 +115,7 @@ libext2fs.so.2 e2fslibs #MINVER#
ext2fs_clear_inode_bitmap@Base 1.37
ext2fs_close2@Base 1.42
ext2fs_close@Base 1.37
ext2fs_close_free@Base 1.42.11
ext2fs_close_inode_scan@Base 1.37
ext2fs_compare_block_bitmap@Base 1.37
ext2fs_compare_generic_bitmap@Base 1.41.0

View File

@ -120,10 +120,9 @@ static void open_filesystem(char *device, int open_flags, blk64_t superblock,
return;
errout:
retval = ext2fs_close(current_fs);
retval = ext2fs_close_free(&current_fs);
if (retval)
com_err(device, retval, "while trying to close filesystem");
current_fs = NULL;
}
void do_open_filesys(int argc, char **argv)
@ -229,10 +228,9 @@ static void close_filesystem(NOARGS)
}
if (current_qctx)
quota_release_context(&current_qctx);
retval = ext2fs_close(current_fs);
retval = ext2fs_close_free(&current_fs);
if (retval)
com_err("ext2fs_close", retval, 0);
current_fs = NULL;
return;
}

View File

@ -154,6 +154,17 @@ static struct field_set_info super_fields[] = {
FLAG_ARRAY, 2 },
{ "checksum", &set_sb.s_checksum, NULL, 4, parse_uint },
{ "checksum_type", &set_sb.s_checksum_type, NULL, 1, parse_uint },
{ "error_count", &set_sb.s_error_count, NULL, 4, parse_uint },
{ "first_error_time", &set_sb.s_first_error_time, NULL, 4, parse_time },
{ "first_error_ino", &set_sb.s_first_error_ino, NULL, 4, parse_uint },
{ "first_error_block", &set_sb.s_first_error_block, NULL, 8, parse_uint },
{ "first_error_func", &set_sb.s_first_error_func, NULL, 32, parse_string },
{ "first_error_line", &set_sb.s_first_error_ino, NULL, 4, parse_uint },
{ "last_error_time", &set_sb.s_last_error_time, NULL, 4, parse_time },
{ "last_error_ino", &set_sb.s_last_error_ino, NULL, 4, parse_uint },
{ "last_error_block", &set_sb.s_last_error_block, NULL, 8, parse_uint },
{ "last_error_func", &set_sb.s_last_error_func, NULL, 32, parse_string },
{ "last_error_line", &set_sb.s_last_error_ino, NULL, 4, parse_uint },
{ 0, 0, 0, 0 }
};

View File

@ -43,15 +43,6 @@ COMPILE_ET=$(top_builddir)/lib/et/compile_et --build-tree
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
#
# Flags for using Checker
# Note: The optimization flags must include -g
#
#MCHECK= -checker
#LIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) $(CHECKLIB)
#DEPLIBS= $(LIBCOM_ERR) $(LIB_EXT2FS)
#CHECKLIB= /usr/lib/libchecker.o
#
# Flags for doing mtrace --- uncomment to produce mtracing e2fsck
# Note: The optimization flags must include -g

View File

@ -232,6 +232,7 @@ struct e2fsck_struct {
blk64_t free_blocks;
ino_t free_inodes;
int mount_flags;
int openfs_flags;
blkid_cache blkid; /* blkid cache */
#ifdef HAVE_SETJMP_H

View File

@ -820,7 +820,6 @@ errcode_t e2fsck_check_ext3_journal(e2fsck_t ctx)
no_has_journal:
if (!(sb->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
recover = sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER;
pctx.str = "inode";
if (fix_problem(ctx, PR_0_JOURNAL_HAS_JOURNAL, &pctx)) {
if (recover &&
!fix_problem(ctx, PR_0_JOURNAL_RECOVER_SET, &pctx))
@ -966,7 +965,7 @@ errcode_t e2fsck_run_ext3_journal(e2fsck_t ctx)
ext2fs_mmp_stop(ctx->fs);
ext2fs_free(ctx->fs);
retval = ext2fs_open(ctx->filesystem_name, EXT2_FLAG_RW,
retval = ext2fs_open(ctx->filesystem_name, ctx->openfs_flags,
ctx->superblock, blocksize, io_ptr,
&ctx->fs);
if (retval) {

View File

@ -116,17 +116,17 @@ static const char *abbrevs[] = {
N_("Bbitmap"),
N_("ccompress"),
N_("Cconflicts with some other fs @b"),
N_("iinode"),
N_("Iillegal"),
N_("jjournal"),
N_("Ddeleted"),
N_("ddirectory"),
N_("Ddeleted"),
N_("eentry"),
N_("E@e '%Dn' in %p (%i)"),
N_("ffilesystem"),
N_("Ffor @i %i (%Q) is"),
N_("ggroup"),
N_("hHTREE @d @i"),
N_("iinode"),
N_("Iillegal"),
N_("jjournal"),
N_("llost+found"),
N_("Lis a link"),
N_("mmultiply-claimed"),

View File

@ -225,7 +225,7 @@ static struct e2fsck_problem problem_table[] = {
/* Superblock has_journal flag is clear but has a journal */
{ PR_0_JOURNAL_HAS_JOURNAL,
N_("@S has_@j flag is clear, but a @j %s is present.\n"),
N_("@S has_@j flag is clear, but a @j is present.\n"),
PROMPT_CLEAR, PR_PREEN_OK },
/* Superblock needs_recovery flag is set but not journal is present */
@ -338,12 +338,12 @@ static struct e2fsck_problem problem_table[] = {
/* Last mount time is in the future */
{ PR_0_FUTURE_SB_LAST_MOUNT,
N_("@S last mount time (%t,\n\tnow = %T) is in the future.\n"),
PROMPT_FIX, PR_NO_OK },
PROMPT_FIX, PR_PREEN_OK | PR_NO_OK },
/* Last write time is in the future */
{ PR_0_FUTURE_SB_LAST_WRITE,
N_("@S last write time (%t,\n\tnow = %T) is in the future.\n"),
PROMPT_FIX, PR_NO_OK },
PROMPT_FIX, PR_PREEN_OK | PR_NO_OK },
{ PR_0_EXTERNAL_JOURNAL_HINT,
N_("@S hint for external superblock @s %X. "),
@ -461,11 +461,11 @@ static struct e2fsck_problem problem_table[] = {
N_("Pass 1: Checking @is, @bs, and sizes\n"),
PROMPT_NONE, 0 },
/* Root directory is not an inode */
/* Root inode is not a directory */
{ PR_1_ROOT_NO_DIR, N_("@r is not a @d. "),
PROMPT_CLEAR, 0 },
/* Root directory has dtime set */
/* Root inode has dtime set */
{ PR_1_ROOT_DTIME,
N_("@r has dtime set (probably due to old mke2fs). "),
PROMPT_FIX, PR_PREEN_OK },

View File

@ -133,7 +133,7 @@ int main (int argc, char *argv[])
}
ext2fs_close(fs);
ext2fs_close_free(&fs);
print_resource_track(&global_rtrack);

View File

@ -458,8 +458,7 @@ static void check_if_skip(e2fsck_t ctx)
}
log_out(ctx, "\n");
skip:
ext2fs_close(fs);
ctx->fs = NULL;
ext2fs_close_free(&fs);
e2fsck_free_context(ctx);
exit(FSCK_OK);
}
@ -1280,6 +1279,7 @@ restart:
flags &= ~EXT2_FLAG_EXCLUSIVE;
}
ctx->openfs_flags = flags;
retval = try_open_fs(ctx, flags, io_ptr, &fs);
if (!ctx->superblock && !(ctx->options & E2F_OPT_PREEN) &&
@ -1313,12 +1313,12 @@ restart:
orig_superblock = ctx->superblock;
get_backup_sb(ctx, fs, ctx->filesystem_name, io_ptr);
if (fs)
ext2fs_close(fs);
ext2fs_close_free(&fs);
orig_retval = retval;
retval = try_open_fs(ctx, flags, io_ptr, &fs);
if ((orig_retval == 0) && retval != 0) {
if (fs)
ext2fs_close(fs);
ext2fs_close_free(&fs);
log_out(ctx, _("%s: %s while using the "
"backup blocks"),
ctx->program_name,
@ -1412,7 +1412,7 @@ failure:
* reopen the filesystem after we get the device size.
*/
if (pctx.errcode == EBUSY) {
ext2fs_close(fs);
ext2fs_close_free(&fs);
need_restart++;
pctx.errcode =
ext2fs_get_device_size2(ctx->filesystem_name,
@ -1468,8 +1468,7 @@ failure:
/*
* Restart in order to reopen fs but this time start mmp.
*/
ext2fs_close(fs);
ctx->fs = NULL;
ext2fs_close_free(&fs);
flags &= ~EXT2_FLAG_SKIP_MMP;
goto restart;
}
@ -1519,8 +1518,7 @@ failure:
ctx->device_name);
fatal_error(ctx, 0);
}
ext2fs_close(ctx->fs);
ctx->fs = 0;
ext2fs_close_free(&ctx->fs);
ctx->flags |= E2F_FLAG_RESTARTED;
goto restart;
}
@ -1699,7 +1697,7 @@ no_journal:
_("while resetting context"));
fatal_error(ctx, 0);
}
ext2fs_close(fs);
ext2fs_close_free(&fs);
goto restart;
}
if (run_result & E2F_FLAG_CANCEL) {
@ -1781,8 +1779,7 @@ no_journal:
io_channel_flush(ctx->fs->io);
print_resource_track(ctx, NULL, &ctx->global_rtrack, ctx->fs->io);
ext2fs_close(fs);
ctx->fs = NULL;
ext2fs_close_free(&fs);
free(ctx->journal_name);
e2fsck_free_context(ctx);

View File

@ -321,7 +321,7 @@ void preenhalt(e2fsck_t ctx)
if (fs != NULL) {
fs->super->s_state |= EXT2_ERROR_FS;
ext2fs_mark_super_dirty(fs);
ext2fs_close(fs);
ext2fs_close_free(&fs);
}
exit(FSCK_UNCORRECTED);
}

View File

@ -1,17 +1,3 @@
all:: $(LIBRARY)_chk.a
real-subdirs:: Makefile
$(E) " MKDIR checker"
$(Q) mkdir -p checker
clean::
$(RM) -rf checker
$(LIBRARY)_chk.a: $(OBJS)
$(E) " GEN_CHECKER_LIB $@"
$(Q) (test -r $@ && $(RM) -f $@.bak && $(MV) $@ $@.bak)
$(Q) (cd checker; $(ARGEN) $@ $(OBJS))
-$(Q) $(RANLIB) $@
$(Q) $(RM) -f ../$@
$(Q) (cd .. ; $(LN) $(LINK_BUILD_FLAGS) \
`echo $(my_dir) | sed -e 's;lib/;;'`/$@ $@)
# This is a placeholder so builds don't break after a "git pull"
# which removed the checker infrastructure. This file can be deleted
# after e2fsprogs 1.44 is released

View File

@ -47,7 +47,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
LIBS_BLKID= $(STATIC_LIBBLKID) $(STATIC_LIBUUID)
DEPLIBS_BLKID= $(DEPSTATIC_LIBBLKID) $(DEPSTATIC_LIBUUID)
@ -58,7 +57,6 @@ DEPLIBS_BLKID= $(DEPSTATIC_LIBBLKID) $(DEPSTATIC_LIBUUID)
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -180,7 +178,7 @@ clean::
tst_devno tst_getsize tst_probe tst_read tst_resolve tst_save \
tst_tag tst_types tests/*.out tests/*.ok \
tests/*.img results test_probe core profiled/* \
checker/* blkid.h blkid_types.h ../libblkid.a ../libblkid_p.a \
blkid.h blkid_types.h ../libblkid.a ../libblkid_p.a \
$(SMANPAGES) blkid
@echo rmdir tests/tmp tests
@(rmdir tests/tmp tests 2> /dev/null ; exit 0)

View File

@ -9,18 +9,26 @@
@ASM_TYPES_HEADER@
#ifndef HAVE___U8
#define HAVE___U8
#ifdef __U8_TYPEDEF
typedef __U8_TYPEDEF __u8;
#else
typedef unsigned char __u8;
#endif
#endif /* HAVE___U8 */
#ifndef HAVE___S8
#define HAVE___S8
#ifdef __S8_TYPEDEF
typedef __S8_TYPEDEF __s8;
#else
typedef signed char __s8;
#endif
#endif /* HAVE___S8 */
#ifndef HAVE___U16
#define HAVE___U16
#ifdef __U16_TYPEDEF
typedef __U16_TYPEDEF __u16;
#else
@ -30,11 +38,15 @@ typedef unsigned int __u16;
#if (@SIZEOF_SHORT@ == 2)
typedef unsigned short __u16;
#else
#undef HAVE___U16
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __U16_TYPEDEF */
#endif /* HAVE___U16 */
#ifndef HAVE___S16
#define HAVE___S16
#ifdef __S16_TYPEDEF
typedef __S16_TYPEDEF __s16;
#else
@ -44,12 +56,15 @@ typedef int __s16;
#if (@SIZEOF_SHORT@ == 2)
typedef short __s16;
#else
#undef HAVE___S16
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __S16_TYPEDEF */
#endif /* HAVE___S16 */
#ifndef HAVE___U32
#define HAVE___U32
#ifdef __U32_TYPEDEF
typedef __U32_TYPEDEF __u32;
#else
@ -62,12 +77,16 @@ typedef unsigned long __u32;
#if (@SIZEOF_SHORT@ == 4)
typedef unsigned short __u32;
#else
#undef HAVE___U32
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __U32_TYPEDEF */
#endif /* HAVE___U32 */
#ifndef HAVE___S32
#define HAVE___S32
#ifdef __S32_TYPEDEF
typedef __S32_TYPEDEF __s32;
#else
@ -80,12 +99,16 @@ typedef long __s32;
#if (@SIZEOF_SHORT@ == 4)
typedef short __s32;
#else
#undef HAVE___S32
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __S32_TYPEDEF */
#endif /* HAVE___S32 */
#ifndef HAVE___U64
#define HAVE___U64
#ifdef __U64_TYPEDEF
typedef __U64_TYPEDEF __u64;
#else
@ -97,11 +120,17 @@ typedef unsigned long long __u64;
#else
#if (@SIZEOF_LONG@ == 8)
typedef unsigned long __u64;
#else
#undef HAVE___U64
?== error: undefined 64 bit type
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __U64_TYPEDEF */
#endif /* HAVE___U64 */
#ifndef HAVE___S64
#define HAVE___S64
#ifdef __S64_TYPEDEF
typedef __S64_TYPEDEF __s64;
#else
@ -117,10 +146,14 @@ typedef signed long long __s64;
#else
#if (@SIZEOF_LONG@ == 8)
typedef long __s64;
#else
#undef HAVE___S64
?== error: undefined 64 bit type
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __S64_TYPEDEF */
#endif /* HAVE___S64 */
#undef __S8_TYPEDEF
#undef __U8_TYPEDEF

View File

@ -11,9 +11,6 @@
*/
#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif

View File

@ -12,7 +12,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
/* include this before sys/queues.h! */
#include "config.h"
#include "blkidP.h"
@ -34,9 +33,6 @@
#include <sys/disklabel.h>
#endif
#ifdef HAVE_SYS_DISK_H
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h> /* for LIST_HEAD */
#endif
#include <sys/disk.h>
#endif
#ifdef __linux__

View File

@ -55,9 +55,18 @@
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the `argz_count' function. */
#undef HAVE_ARGZ_COUNT
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to 1 if you have the `argz_next' function. */
#undef HAVE_ARGZ_NEXT
/* Define to 1 if you have the `argz_stringify' function. */
#undef HAVE_ARGZ_STRINGIFY
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
@ -70,6 +79,17 @@
/* Define to 1 if you have the `blkid_probe_get_topology' function. */
#undef HAVE_BLKID_PROBE_GET_TOPOLOGY
/* Define to 1 if the compiler understands __builtin_expect. */
#undef HAVE_BUILTIN_EXPECT
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
#undef HAVE_CFLOCALECOPYCURRENT
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* Define to 1 if you have the `chflags' function. */
#undef HAVE_CHFLAGS
@ -130,6 +150,9 @@
/* Define to 1 if you have the `fdatasync' function. */
#undef HAVE_FDATASYNC
/* Define to 1 if you have the <features.h> header file. */
#undef HAVE_FEATURES_H
/* Define to 1 if you have the `fstat64' function. */
#undef HAVE_FSTAT64
@ -181,7 +204,7 @@
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define if you have the iconv() function. */
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
@ -227,14 +250,8 @@
/* Define to 1 if llseek declared in unistd.h */
#undef HAVE_LLSEEK_PROTOTYPE
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the 'long double' type. */
#undef HAVE_LONG_DOUBLE
/* Define if you have the 'long long' type. */
#undef HAVE_LONG_LONG
/* Define to 1 if the system has the type 'long long int'. */
#undef HAVE_LONG_LONG_INT
/* Define to 1 if you have the `lseek64' function. */
#undef HAVE_LSEEK64
@ -248,6 +265,9 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the `mbrtowc' function. */
#undef HAVE_MBRTOWC
/* Define to 1 if you have the `mbstowcs' function. */
#undef HAVE_MBSTOWCS
@ -284,8 +304,8 @@
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define to 1 if you have the `newlocale' function. */
#undef HAVE_NEWLOCALE
/* Define to 1 if you have the `open64' function. */
#undef HAVE_OPEN64
@ -314,6 +334,12 @@
/* Define to 1 if you have the `prctl' function. */
#undef HAVE_PRCTL
/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
#undef HAVE_PTHREAD_MUTEX_RECURSIVE
/* Define if the POSIX multithreading library has read/write locks. */
#undef HAVE_PTHREAD_RWLOCK
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
@ -408,6 +434,9 @@
/* Define to 1 if `st_atim' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_ATIM
/* Define to 1 if you have the `symlink' function. */
#undef HAVE_SYMLINK
/* Define to 1 if you have the `sync_file_range' function. */
#undef HAVE_SYNC_FILE_RANGE
@ -441,9 +470,6 @@
/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/queue.h> header file. */
#undef HAVE_SYS_QUEUE_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
@ -495,8 +521,11 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the 'unsigned long long' type. */
#undef HAVE_UNSIGNED_LONG_LONG
/* Define to 1 if the system has the type 'unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
/* Define to 1 if you have the `uselocale' function. */
#undef HAVE_USELOCALE
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
@ -510,26 +539,33 @@
/* Define to 1 if you have the `valloc' function. */
#undef HAVE_VALLOC
/* Define to 1 or 0, depending whether the compiler supports simple visibility
declarations. */
#undef HAVE_VISIBILITY
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define if you have the 'wchar_t' type. */
#undef HAVE_WCHAR_T
/* Define to 1 if you have the `wcrtomb' function. */
#undef HAVE_WCRTOMB
/* Define to 1 if you have the `wcslen' function. */
#undef HAVE_WCSLEN
/* Define to 1 if you have the `wcsnlen' function. */
#undef HAVE_WCSNLEN
/* Define if you have the 'wint_t' type. */
#undef HAVE_WINT_T
/* Define to 1 if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
/* Define to 1 if O_NOATIME works. */
#undef HAVE_WORKING_O_NOATIME
/* Define to 1 if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
/* Define to 1 if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define to 1 if O_NOFOLLOW works. */
#undef HAVE_WORKING_O_NOFOLLOW
/* Define to 1 if you have the `__fsetlocking' function. */
#undef HAVE___FSETLOCKING
@ -567,6 +603,9 @@
/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
#undef PRI_MACROS_BROKEN
/* Define if the pthread_in_use() detection is hard. */
#undef PTHREAD_IN_USE_DETECTION_HARD
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
@ -584,7 +623,9 @@
/* Define as the maximum value of type 'size_t', if the system doesn't define
it. */
#undef SIZE_MAX
#ifndef SIZE_MAX
# undef SIZE_MAX
#endif
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
@ -600,9 +641,55 @@
/* If the compiler supports a TLS storage class define it to that here */
#undef TLS
/* Define if the POSIX multithreading library can be used. */
#undef USE_POSIX_THREADS
/* Define if references to the POSIX multithreading library should be made
weak. */
#undef USE_POSIX_THREADS_WEAK
/* Define if the GNU Pth multithreading library can be used. */
#undef USE_PTH_THREADS
/* Define if references to the GNU Pth multithreading library should be made
weak. */
#undef USE_PTH_THREADS_WEAK
/* Define if the old Solaris multithreading library can be used. */
#undef USE_SOLARIS_THREADS
/* Define if references to the old Solaris multithreading library should be
made weak. */
#undef USE_SOLARIS_THREADS_WEAK
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define to 1 to build uuidd */
#undef USE_UUIDD
/* Define if the native Windows multithreading API can be used. */
#undef USE_WINDOWS_THREADS
/* version for gettext */
#undef VERSION
@ -621,8 +708,75 @@
/* Define to 1 if Apple Darwin libintl workaround is needed */
#undef _INTL_REDIRECT_MACROS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Please see the Gnulib manual for how to use these macros.
Suppress extern inline with HP-UX cc, as it appears to be broken; see
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
Suppress extern inline with Sun C in standards-conformance mode, as it
mishandles inline functions that call each other. E.g., for 'inline void f
(void) { } inline void g (void) { f (); }', c99 incorrectly complains
'reference to static identifier "f" in extern inline function'.
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
Suppress the use of extern inline on Apple's platforms, as Libc at least
through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
#if ((__GNUC__ \
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
: (199901L <= __STDC_VERSION__ \
&& !defined __HP_cc \
&& !(defined __SUNPRO_C && __STDC__))) \
&& !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
&& !defined __APPLE__)
# if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
# else
# define _GL_INLINE extern inline
# endif
# define _GL_EXTERN_INLINE extern
#else
# define _GL_INLINE static _GL_UNUSED
# define _GL_EXTERN_INLINE static _GL_UNUSED
#endif
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
# define _GL_INLINE_HEADER_CONST_PRAGMA
# else
# define _GL_INLINE_HEADER_CONST_PRAGMA \
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
# endif
/* Suppress GCC's bogus "no previous prototype for 'FOO'"
and "no previous declaration for 'FOO'" diagnostics,
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
# define _GL_INLINE_HEADER_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
_GL_INLINE_HEADER_CONST_PRAGMA
# define _GL_INLINE_HEADER_END \
_Pragma ("GCC diagnostic pop")
#else
# define _GL_INLINE_HEADER_BEGIN
# define _GL_INLINE_HEADER_END
#endif
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
@ -630,16 +784,10 @@
#undef inline
#endif
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define as the type of the result of subtracting two pointers, if the system
doesn't define it. */
#undef ptrdiff_t
/* Define to empty if the C compiler doesn't support this keyword. */
#undef signed
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
@ -648,3 +796,44 @@
#undef uintmax_t
#include <dirpaths.h>
#define __libc_lock_t gl_lock_t
#define __libc_lock_define gl_lock_define
#define __libc_lock_define_initialized gl_lock_define_initialized
#define __libc_lock_init gl_lock_init
#define __libc_lock_lock gl_lock_lock
#define __libc_lock_unlock gl_lock_unlock
#define __libc_lock_recursive_t gl_recursive_lock_t
#define __libc_lock_define_recursive gl_recursive_lock_define
#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
#define __libc_lock_init_recursive gl_recursive_lock_init
#define __libc_lock_lock_recursive gl_recursive_lock_lock
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
#define glthread_in_use libintl_thread_in_use
#define glthread_lock_init_func libintl_lock_init_func
#define glthread_lock_lock_func libintl_lock_lock_func
#define glthread_lock_unlock_func libintl_lock_unlock_func
#define glthread_lock_destroy_func libintl_lock_destroy_func
#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
#define glthread_rwlock_init_func libintl_rwlock_init_func
#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
#define glthread_once_func libintl_once_func
#define glthread_once_singlethreaded libintl_once_singlethreaded
#define glthread_once_multithreaded libintl_once_multithreaded

View File

@ -50,7 +50,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
.c.o:
$(E) " CC $<"
@ -58,7 +57,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -103,7 +101,7 @@ uninstall::
$(RM) -rf $(DESTDIR)$(includedir)/e2p
clean::
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/*
$(RM) -f ../libe2p.a ../libe2p_p.a tst_ostype tst_feature
mostlyclean:: clean

View File

@ -46,7 +46,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -54,7 +53,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
compile_et: $(DEP_SUBSTITUTE) $(srcdir)/compile_et.sh.in
$(E) " SUBST $@"

View File

@ -17,9 +17,6 @@
*/
#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -225,7 +225,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
all:: ext2fs.pc tst_libext2fs
@ -235,7 +234,6 @@ all:: ext2fs.pc tst_libext2fs
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -525,7 +523,7 @@ uninstall::
$(RM) -rf $(DESTDIR)$(includedir)/ext2fs
clean::
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* \
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* \
tst_badblocks tst_iscan ext2_err.et ext2_err.c ext2_err.h \
tst_byteswap tst_ismounted tst_getsize tst_sectgetsize \
tst_bitops tst_types tst_icount tst_super_size tst_csum \

View File

@ -47,16 +47,17 @@ static blk64_t flexbg_offset(ext2_filsys fs, dgrp_t group, blk64_t start_blk,
flexbg = group / flexbg_size;
size = rem_grp * elem_size;
if (size > (int) (fs->super->s_blocks_per_group / 8))
size = (int) fs->super->s_blocks_per_group / 8;
if (size > (int) (fs->super->s_blocks_per_group / 4))
size = (int) fs->super->s_blocks_per_group / 4;
/*
* Don't do a long search if the previous block
* search is still valid.
* Don't do a long search if the previous block search is still valid,
* but skip minor obstructions such as group descriptor backups.
*/
if (start_blk && start_blk < ext2fs_blocks_count(fs->super) &&
ext2fs_test_block_bitmap_range2(bmap, start_blk, elem_size))
return start_blk;
ext2fs_get_free_blocks2(fs, start_blk, start_blk + size, elem_size,
bmap, &first_free) == 0)
return first_free;
start_blk = ext2fs_group_first_block2(fs, flexbg_size * flexbg);
last_grp = group | (flexbg_size - 1);
@ -125,6 +126,8 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
if (group % flexbg_size)
prev_block = ext2fs_block_bitmap_loc(fs, group - 1) + 1;
/* FIXME: Take backup group descriptor blocks into account
* if the flexbg allocations will grow to overlap them... */
start_blk = flexbg_offset(fs, group, prev_block, bmap,
rem_grps, 1);
last_blk = ext2fs_group_last_block2(fs, last_grp);
@ -156,6 +159,8 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
else
prev_block = ext2fs_block_bitmap_loc(fs, group) +
flexbg_size;
/* FIXME: Take backup group descriptor blocks into account
* if the flexbg allocations will grow to overlap them... */
start_blk = flexbg_offset(fs, group, prev_block, bmap,
rem_grps, 1);
last_blk = ext2fs_group_last_block2(fs, last_grp);
@ -193,6 +198,8 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
prev_block = ext2fs_inode_bitmap_loc(fs, group) +
flexbg_size;
/* FIXME: Take backup group descriptor blocks into account
* if the flexbg allocations will grow to overlap them... */
group_blk = flexbg_offset(fs, group, prev_block, bmap,
rem_grps, fs->inode_blocks_per_group);
last_blk = ext2fs_group_last_block2(fs, last_grp);

View File

@ -450,6 +450,18 @@ errout:
return retval;
}
errcode_t ext2fs_close_free(ext2_filsys *fs_ptr)
{
errcode_t ret;
ext2_filsys fs = *fs_ptr;
ret = ext2fs_close2(fs, 0);
if (ret)
ext2fs_free(fs);
*fs_ptr = NULL;
return ret;
}
errcode_t ext2fs_close(ext2_filsys fs)
{
return ext2fs_close2(fs, 0);

View File

@ -9,18 +9,26 @@
@ASM_TYPES_HEADER@
#ifndef HAVE___U8
#define HAVE___U8
#ifdef __U8_TYPEDEF
typedef __U8_TYPEDEF __u8;
#else
typedef unsigned char __u8;
#endif
#endif /* HAVE___U8 */
#ifndef HAVE___S8
#define HAVE___S8
#ifdef __S8_TYPEDEF
typedef __S8_TYPEDEF __s8;
#else
typedef signed char __s8;
#endif
#endif /* HAVE___S8 */
#ifndef HAVE___U16
#define HAVE___U16
#ifdef __U16_TYPEDEF
typedef __U16_TYPEDEF __u16;
#else
@ -30,11 +38,15 @@ typedef unsigned int __u16;
#if (@SIZEOF_SHORT@ == 2)
typedef unsigned short __u16;
#else
#undef HAVE___U16
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __U16_TYPEDEF */
#endif /* HAVE___U16 */
#ifndef HAVE___S16
#define HAVE___S16
#ifdef __S16_TYPEDEF
typedef __S16_TYPEDEF __s16;
#else
@ -44,12 +56,15 @@ typedef int __s16;
#if (@SIZEOF_SHORT@ == 2)
typedef short __s16;
#else
#undef HAVE___S16
?==error: undefined 16 bit type
#endif /* SIZEOF_SHORT == 2 */
#endif /* SIZEOF_INT == 2 */
#endif /* __S16_TYPEDEF */
#endif /* HAVE___S16 */
#ifndef HAVE___U32
#define HAVE___U32
#ifdef __U32_TYPEDEF
typedef __U32_TYPEDEF __u32;
#else
@ -62,12 +77,16 @@ typedef unsigned long __u32;
#if (@SIZEOF_SHORT@ == 4)
typedef unsigned short __u32;
#else
#undef HAVE___U32
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __U32_TYPEDEF */
#endif /* HAVE___U32 */
#ifndef HAVE___S32
#define HAVE___S32
#ifdef __S32_TYPEDEF
typedef __S32_TYPEDEF __s32;
#else
@ -80,12 +99,16 @@ typedef long __s32;
#if (@SIZEOF_SHORT@ == 4)
typedef short __s32;
#else
#undef HAVE___S32
?== error: undefined 32 bit type
#endif /* SIZEOF_SHORT == 4 */
#endif /* SIZEOF_LONG == 4 */
#endif /* SIZEOF_INT == 4 */
#endif /* __S32_TYPEDEF */
#endif /* HAVE___S32 */
#ifndef HAVE___U64
#define HAVE___U64
#ifdef __U64_TYPEDEF
typedef __U64_TYPEDEF __u64;
#else
@ -97,11 +120,17 @@ typedef unsigned long long __u64;
#else
#if (@SIZEOF_LONG@ == 8)
typedef unsigned long __u64;
#else
#undef HAVE___U64
?== error: undefined 64 bit type
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __U64_TYPEDEF */
#endif /* HAVE___U64 */
#ifndef HAVE___S64
#define HAVE___S64
#ifdef __S64_TYPEDEF
typedef __S64_TYPEDEF __s64;
#else
@ -117,10 +146,14 @@ typedef signed long long __s64;
#else
#if (@SIZEOF_LONG@ == 8)
typedef long __s64;
#else
#undef HAVE___S64
?== error: undefined 64 bit type
#endif /* SIZEOF_LONG_LONG == 8 */
#endif /* SIZEOF_LONG == 8 */
#endif /* SIZEOF_INT == 8 */
#endif /* __S64_TYPEDEF */
#endif /* HAVE___S64 */
#undef __S8_TYPEDEF
#undef __U8_TYPEDEF

View File

@ -955,6 +955,7 @@ extern errcode_t ext2fs_check_desc(ext2_filsys fs);
/* closefs.c */
extern errcode_t ext2fs_close(ext2_filsys fs);
extern errcode_t ext2fs_close2(ext2_filsys fs, int flags);
extern errcode_t ext2fs_close_free(ext2_filsys *fs);
extern errcode_t ext2fs_flush(ext2_filsys fs);
extern errcode_t ext2fs_flush2(ext2_filsys fs, int flags);
extern int ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group_block);

View File

@ -34,9 +34,6 @@
#include <sys/disklabel.h>
#endif
#ifdef HAVE_SYS_DISK_H
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h> /* for LIST_HEAD */
#endif
#include <sys/disk.h>
#endif
#ifdef __linux__

View File

@ -91,8 +91,10 @@ errcode_t ext2fs_initialize(const char *name, int flags,
unsigned int rem;
unsigned int overhead = 0;
unsigned int ipg;
unsigned int flexbg_size;
dgrp_t i;
blk64_t free_blocks;
blk64_t flexbg_overhead;
blk_t numblocks;
int rsv_gdt;
int csum_flag;
@ -418,6 +420,28 @@ ipg_retry:
goto retry;
}
/*
* Calculate the flex_bg related metadata blocks count.
* It includes the boot block, the super block,
* the block group descriptors, the reserved gdt blocks,
* the block bitmaps, the inode bitmaps and the inode tables.
* This is a simple check, so that the backup superblock and
* other feature related blocks are not considered.
*/
flexbg_size = 1 << fs->super->s_log_groups_per_flex;
flexbg_overhead = super->s_first_data_block + 1 +
fs->desc_blocks + super->s_reserved_gdt_blocks +
(__u64)flexbg_size * (2 + fs->inode_blocks_per_group);
/*
* Disallow creating ext4 which breaks flex_bg metadata layout
* obviously.
*/
if (flexbg_overhead > ext2fs_blocks_count(fs->super)) {
retval = EXT2_ET_INVALID_ARGUMENT;
goto cleanup;
}
/*
* At this point we know how big the filesystem will be. So
* we can do any and all allocations that depend on the block

View File

@ -642,7 +642,7 @@ main(int argc, char **argv)
if (retval) {
printf("Warning, had trouble writing out superblocks.\n");
}
ext2fs_close(fs);
ext2fs_close_free(&fs);
exit(0);
}

View File

@ -10,12 +10,6 @@
*/
#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H

View File

@ -187,8 +187,7 @@ static void setup_filesystem(const char *name,
return;
errout:
ext2fs_close(test_fs);
test_fs = 0;
ext2fs_close_free(&test_fs);
}
void setup_cmd(int argc, char **argv)
@ -199,10 +198,8 @@ void setup_cmd(int argc, char **argv)
unsigned int type = EXT2FS_BMAP64_BITARRAY;
int flags = EXT2_FLAG_64BITS;
if (test_fs) {
ext2fs_close(test_fs);
test_fs = 0;
}
if (test_fs)
ext2fs_close_free(&test_fs);
reset_getopt();
while ((c = getopt(argc, argv, "b:i:lt:")) != EOF) {
@ -242,8 +239,7 @@ void close_cmd(int argc, char **argv)
if (check_fs_open(argv[0]))
return;
ext2fs_close(test_fs);
test_fs = 0;
ext2fs_close_free(&test_fs);
}

View File

@ -37,8 +37,8 @@ static int print_blocks_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
blk64_t ref_block, int ref_offset,
void *private EXT2FS_ATTR((unused)))
{
printf("%6d %8llu (%d %llu)\n", blockcnt, *blocknr,
ref_offset, ref_block);
printf("%6lld %8llu (%d %llu)\n", (long long) blockcnt,
(unsigned long long)*blocknr, ref_offset, ref_block);
return 0;
}

View File

@ -39,7 +39,6 @@ LIBDIR= quota
#MAKEFILE_ELF#
#MAKEFILE_BSDLIB#
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
.c.o:
$(E) " CC $<"
@ -47,7 +46,6 @@ LIBDIR= quota
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
#ELF_CMT# $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
#BSDLIB_CMT# $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -56,8 +54,6 @@ dict.o:
$(Q) $(CC) -c $(ALL_CFLAGS) $(top_srcdir)/e2fsck/dict.c -o $@
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/dict.o -c \
@PROFILE_CMT@ $(top_srcdir)/e2fsck/dict.c
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c \
@CHECKER_CMT@ $(top_srcdir)/e2fsck/dict.c
#ELF_CMT# $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c \
#ELF_CMT# $(top_srcdir)/e2fsck/dict.c
#BSDLIB_CMT# $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c \
@ -70,7 +66,7 @@ install:: all
uninstall::
clean::
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/*
$(RM) -f ../libquota.a ../libquota_p.a $(SMANPAGES)
#check:: tst_uuid

View File

@ -37,7 +37,6 @@ MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -DSHARED_ELF_LIB -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -64,7 +63,6 @@ all:: mk_cmds
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
CODE= $(SRCS) $(MKCMDSFILES)

View File

@ -15,9 +15,6 @@
*/
#include "config.h"
#if HAVE_SECURE_GETENV
#define _GNU_SOURCE
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

View File

@ -57,7 +57,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
@MAKEFILE_ELF@
@MAKEFILE_BSDLIB@
@MAKEFILE_PROFILE@
@MAKEFILE_CHECKER@
.c.o:
$(E) " CC $<"
@ -65,7 +64,6 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
@PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
@BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
@ -169,7 +167,7 @@ uninstall::
$(RM) -f $(DESTDIR)$(man3dir)/uuid_generate_random.3 $(DESTDIR)$(man3dir)/uuid_generate_time.3
clean::
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* uuid.h
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* uuid.h
$(RM) -f ../libuuid.a ../libuuid_p.a tst_uuid uuid_time $(SMANPAGES)
check:: tst_uuid

View File

@ -19,24 +19,45 @@ chattr \- change file attributes on a Linux file system
.B chattr
changes the file attributes on a Linux file system.
.PP
The format of a symbolic mode is +-=[acdeijstuACDST].
The format of a symbolic mode is +-=[aAcCdDeijsStTu].
.PP
The operator `+' causes the selected attributes to be added to the
existing attributes of the files; `-' causes them to be removed; and
`=' causes them to be the only attributes that the files have.
The operator '+' causes the selected attributes to be added to the
existing attributes of the files; '-' causes them to be removed; and
'=' causes them to be the only attributes that the files have.
.PP
The letters `acdeijstuACDST' select the new attributes for the files:
append only (a), compressed (c), no dump (d), extent format (e), immutable (i),
data journalling (j), secure deletion (s), no tail-merging (t),
undeletable (u), no atime updates (A), no copy on write (C),
synchronous directory updates (D), synchronous updates (S),
and top of directory hierarchy (T).
The letters 'aAcCdDeijsStTu' select the new attributes for the files:
append only (a),
no atime updates (A),
compressed (c),
no copy on write (C),
no dump (d),
synchronous directory updates (D),
extent format (e),
immutable (i),
data journalling (j),
secure deletion (s),
synchronous updates (S),
no tail-merging (t),
top of directory hierarchy (T),
and undeletable (u).
.PP
The following attributes are read-only, and may be listed by
.BR lsattr (1)
but not modified by chattr: huge file (h), compression error (E),
indexed directory (I), compression raw access (X), and compressed dirty
file (Z).
but not modified by chattr:
compression error (E),
huge file (h),
indexed directory (I),
inline data (N),
compression raw access (X),
and compressed dirty file (Z).
.PP
Not all flags are supported or utilized by all filesystems; refer to
filesystem-specific man pages such as
.BR btrfs (5),
.BR ext4 (5),
and
.BR xfs (5)
for more filesystem-specific details.
.SH OPTIONS
.TP
.B \-R
@ -51,15 +72,15 @@ Suppress most error messages.
.BI \-v " version"
Set the file's version/generation number.
.SH ATTRIBUTES
A file with the 'a' attribute set can only be open in append mode for writing.
Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
capability can set or clear this attribute.
.PP
When a file with the 'A' attribute set is accessed, its atime record is
not modified. This avoids a certain amount of disk I/O for laptop
systems.
.PP
A file with the `a' attribute set can only be open in append mode for writing.
Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
capability can set or clear this attribute.
.PP
A file with the `c' attribute set is automatically compressed on the disk
A file with the 'c' attribute set is automatically compressed on the disk
by the kernel. A read from this file returns uncompressed data. A write to
this file compresses data before storing them on the disk. Note: please
make sure to read the bugs and limitations section at the end of this
@ -74,27 +95,21 @@ be fully stable. If the 'C' flag is set on a directory, it will have no
effect on the directory, but new files created in that directory will
the No_COW attribute.)
.PP
When a directory with the `D' attribute set is modified,
the changes are written synchronously on the disk; this is equivalent to
the `dirsync' mount option applied to a subset of the files.
.PP
A file with the `d' attribute set is not candidate for backup when the
A file with the 'd' attribute set is not candidate for backup when the
.BR dump (8)
program is run.
.PP
The 'E' attribute is used by the experimental compression patches to
indicate that a compressed file has a compression error. It may not be
set or reset using
.BR chattr (1),
although it can be displayed by
.BR lsattr (1).
When a directory with the 'D' attribute set is modified,
the changes are written synchronously on the disk; this is equivalent to
the 'dirsync' mount option applied to a subset of the files.
.PP
The 'e' attribute indicates that the file is using extents for mapping
the blocks on disk. It may not be removed using
.BR chattr (1).
.PP
The 'I' attribute is used by the htree code to indicate that a directory
is being indexed using hashed trees. It may not be set or reset using
The 'E' attribute is used by the experimental compression patches to
indicate that a compressed file has a compression error. It may not be
set or reset using
.BR chattr (1),
although it can be displayed by
.BR lsattr (1).
@ -106,12 +121,18 @@ is (or at one time was) larger than 2TB. It may not be set or reset using
although it can be displayed by
.BR lsattr (1).
.PP
A file with the `i' attribute cannot be modified: it cannot be deleted or
A file with the 'i' attribute cannot be modified: it cannot be deleted or
renamed, no link can be created to this file and no data can be written
to the file. Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
.PP
A file with the `j' attribute has all of its data written to the ext3
The 'I' attribute is used by the htree code to indicate that a directory
is being indexed using hashed trees. It may not be set or reset using
.BR chattr (1),
although it can be displayed by
.BR lsattr (1).
.PP
A file with the 'j' attribute has all of its data written to the ext3
or ext4 journal before being written to the file itself, if the filesystem
is mounted with the "data=ordered" or "data=writeback" options. When the
filesystem is mounted with the "data=journal" option all file data
@ -119,13 +140,26 @@ is already journalled and this attribute has no effect. Only
the superuser or a process possessing the CAP_SYS_RESOURCE
capability can set or clear this attribute.
.PP
When a file with the `s' attribute set is deleted, its blocks are zeroed
A file with the 'N' attribute set indicates that the file has data
stored inline, within the inode itself. It may not be set or reset using
.BR chattr (1),
although it can be displayed by
.BR lsattr (1).
.PP
When a file with the 's' attribute set is deleted, its blocks are zeroed
and written back to the disk. Note: please make sure to read the bugs
and limitations section at the end of this document.
.PP
When a file with the `S' attribute set is modified,
When a file with the 'S' attribute set is modified,
the changes are written synchronously on the disk; this is equivalent to
the `sync' mount option applied to a subset of the files.
the 'sync' mount option applied to a subset of the files.
.PP
A file with the 't' attribute will not have a partial block fragment at
the end of the file merged with other files (for those filesystems which
support tail-merging). This is necessary for applications such as LILO
which read the filesystem directly, and which don't understand tail-merged
files. Note: As of this writing, the ext2 or ext3 filesystems do not
(yet, except in very experimental patches) support tail-merging.
.PP
A directory with the 'T' attribute will be deemed to be the top of
directory hierarchies for the purposes of the Orlov block allocator.
@ -137,20 +171,13 @@ and /home/mary are placed into separate block groups. For directories
where this attribute is not set, the Orlov block allocator will try to
group subdirectories closer together where possible.
.PP
A file with the 't' attribute will not have a partial block fragment at
the end of the file merged with other files (for those filesystems which
support tail-merging). This is necessary for applications such as LILO
which read the filesystem directly, and which don't understand tail-merged
files. Note: As of this writing, the ext2 or ext3 filesystems do not
(yet, except in very experimental patches) support tail-merging.
.PP
When a file with the `u' attribute set is deleted, its contents are
When a file with the 'u' attribute set is deleted, its contents are
saved. This allows the user to ask for its undeletion. Note: please
make sure to read the bugs and limitations section at the end of this
document.
.PP
The 'X' attribute is used by the experimental compression patches to
indicate that a raw contents of a compressed file can be accessed
indicate that the raw contents of a compressed file can be accessed
directly. It currently may not be set or reset using
.BR chattr (1),
although it can be displayed by
@ -167,16 +194,19 @@ although it can be displayed by
was written by Remy Card <Remy.Card@linux.org>. It is currently being
maintained by Theodore Ts'o <tytso@alum.mit.edu>.
.SH BUGS AND LIMITATIONS
The `c', 's', and `u' attributes are not honored
The 'c', 's', and 'u' attributes are not honored
by the ext2, ext3, and ext4 filesystems as implemented in the current
mainline Linux kernels.
.PP
The `j' option is only useful if the filesystem is mounted as ext3 or ext4.
The 'j' option is only useful if the filesystem is mounted as ext3 or ext4.
.PP
The `D' option is only useful on Linux kernel 2.5.19 and later.
The 'D' option is only useful on Linux kernel 2.5.19 and later.
.SH AVAILABILITY
.B chattr
is part of the e2fsprogs package and is available from
http://e2fsprogs.sourceforge.net.
.SH SEE ALSO
.BR lsattr (1)
.BR lsattr (1),
.BR btrfs (5),
.BR ext4 (5),
.BR xfs (5).

View File

@ -83,7 +83,7 @@ static unsigned long sf;
static void usage(void)
{
fprintf(stderr,
_("Usage: %s [-RVf] [-+=AaCcDdeijsSu] [-v version] files...\n"),
_("Usage: %s [-RVf] [-+=aAcCdDeijsStTu] [-v version] files...\n"),
program_name);
exit(1);
}

View File

@ -651,7 +651,7 @@ int main (int argc, char ** argv)
if (fs->super->s_feature_incompat &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
print_journal_information(fs);
ext2fs_close(fs);
ext2fs_close_free(&fs);
exit(0);
}
if ((fs->super->s_feature_compat &
@ -660,7 +660,7 @@ int main (int argc, char ** argv)
print_inline_journal_information(fs);
list_bad_blocks(fs, 0);
if (header_only) {
ext2fs_close (fs);
ext2fs_close_free(&fs);
exit (0);
}
retval = ext2fs_read_bitmaps (fs);
@ -671,7 +671,7 @@ int main (int argc, char ** argv)
error_message(retval));
}
}
ext2fs_close (fs);
ext2fs_close_free(&fs);
remove_error_table(&et_ext2_error_table);
exit (0);
}

View File

@ -215,7 +215,7 @@ static errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info,
static void close_device(char *device_name, ext2_filsys fs)
{
int retval = ext2fs_close(fs);
int retval = ext2fs_close_free(&fs);
if (retval)
com_err(device_name, retval, "while closing the filesystem.\n");

View File

@ -1426,7 +1426,7 @@ static void install_image(char *device, char *image_fn, int type)
}
close(fd);
ext2fs_close (fs);
ext2fs_close_free(&fs);
}
static struct ext2_qcow2_hdr *check_qcow2_image(int *fd, char *name)
@ -1660,7 +1660,7 @@ skip_device:
else
write_image_file(fs, fd);
ext2fs_close (fs);
ext2fs_close_free(&fs);
if (check)
printf(_("%d blocks already contained the data to be copied\n"),
skipped_blocks);

View File

@ -1808,7 +1808,7 @@ int main(int argc, char *argv[])
feature_incompat = fs->super->s_feature_incompat;
log_groups_per_flex = fs->super->s_log_groups_per_flex;
ext2fs_close(fs);
ext2fs_close_free(&fs);
}
switch (arg_type) {

View File

@ -254,10 +254,368 @@ and it also speeds up the time required for
.BR mke2fs (8)
to create the file system.
.RE
.SH MOUNT OPTIONS
This section describes mount options which are specific to ext2, ext3,
and ext4. Other generic mount options may be used as well; see
.BR mount (8)
for details.
.SH "Mount options for ext2"
The `ext2' filesystem is the standard Linux filesystem.
Since Linux 2.5.46, for most mount options the default
is determined by the filesystem superblock. Set them with
.BR tune2fs (8).
.TP
.BR acl | noacl
Support POSIX Access Control Lists (or not).
.TP
.BR bsddf | minixdf
Set the behavior for the
.I statfs
system call. The
.B minixdf
behavior is to return in the
.I f_blocks
field the total number of blocks of the filesystem, while the
.B bsddf
behavior (which is the default) is to subtract the overhead blocks
used by the ext2 filesystem and not available for file storage. Thus
.sp 1
% mount /k \-o minixdf; df /k; umount /k
.TS
tab(#);
l2 l2 r2 l2 l2 l
l c r c c l.
Filesystem#1024-blocks#Used#Available#Capacity#Mounted on
/dev/sda6#2630655#86954#2412169#3%#/k
.TE
.sp 1
% mount /k \-o bsddf; df /k; umount /k
.TS
tab(#);
l2 l2 r2 l2 l2 l
l c r c c l.
Filesystem#1024-blocks#Used#Available#Capacity#Mounted on
/dev/sda6#2543714#13#2412169#0%#/k
.TE
.sp 1
(Note that this example shows that one can add command line options
to the options given in
.IR /etc/fstab .)
.TP
.BR check=none " or " nocheck
No checking is done at mount time. This is the default. This is fast.
It is wise to invoke
.BR e2fsck (8)
every now and then, e.g.\& at boot time. The non-default behavior is unsupported
(check=normal and check=strict options have been removed). Note that these mount options
don't have to be supported if ext4 kernel driver is used for ext2 and ext3 filesystems.
.TP
.B debug
Print debugging info upon each (re)mount.
.TP
.BR errors= { continue | remount-ro | panic }
Define the behavior when an error is encountered.
(Either ignore errors and just mark the filesystem erroneous and continue,
or remount the filesystem read-only, or panic and halt the system.)
The default is set in the filesystem superblock, and can be
changed using
.BR tune2fs (8).
.TP
.BR grpid | bsdgroups " and " nogrpid | sysvgroups
These options define what group id a newly created file gets.
When
.B grpid
is set, it takes the group id of the directory in which it is created;
otherwise (the default) it takes the fsgid of the current process, unless
the directory has the setgid bit set, in which case it takes the gid
from the parent directory, and also gets the setgid bit set
if it is a directory itself.
.TP
.BR grpquota | noquota | quota | usrquota
The usrquota (same as quota) mount option enables user quota support on the
filesystem. grpquota enables group quotas support. You need the quota utilities
to actually enable and manage the quota system.
.TP
.B nouid32
Disables 32-bit UIDs and GIDs. This is for interoperability with older
kernels which only store and expect 16-bit values.
.TP
.BR oldalloc " or " orlov
Use old allocator or Orlov allocator for new inodes. Orlov is default.
.TP
\fBresgid=\fP\,\fIn\fP and \fBresuid=\fP\,\fIn\fP
The ext2 filesystem reserves a certain percentage of the available
space (by default 5%, see
.BR mke2fs (8)
and
.BR tune2fs (8)).
These options determine who can use the reserved blocks.
(Roughly: whoever has the specified uid, or belongs to the specified group.)
.TP
.BI sb= n
Instead of block 1, use block
.I n
as superblock. This could be useful when the filesystem has been damaged.
(Earlier, copies of the superblock would be made every 8192 blocks: in
block 1, 8193, 16385, \&...\& (and one got thousands of copies on
a big filesystem). Since version 1.08,
.B mke2fs
has a \-s (sparse superblock) option to reduce the number of backup
superblocks, and since version 1.15 this is the default. Note
that this may mean that ext2 filesystems created by a recent
.B mke2fs
cannot be mounted r/w under Linux 2.0.*.)
The block number here uses 1\ k units. Thus, if you want to use logical
block 32768 on a filesystem with 4\ k blocks, use "sb=131072".
.TP
.BR user_xattr | nouser_xattr
Support "user." extended attributes (or not).
.SH "Mount options for ext3"
The ext3 filesystem is a version of the ext2 filesystem which has been
enhanced with journaling. It supports the same options as ext2 as
well as the following additions:
.TP
.B journal=update
Update the ext3 filesystem's journal to the current format.
.TP
.B journal=inum
When a journal already exists, this option is ignored. Otherwise, it
specifies the number of the inode which will represent the ext3 filesystem's
journal file; ext3 will create a new journal, overwriting the old contents
of the file whose inode number is
.IR inum .
.TP
.BR journal_dev=devnum / journal_path=path
When the external journal device's major/minor numbers
have changed, these options allow the user to specify
the new journal location. The journal device is
identified either through its new major/minor numbers encoded
in devnum, or via a path to the device.
.TP
.BR norecovery / noload
Don't load the journal on mounting. Note that
if the filesystem was not unmounted cleanly,
skipping the journal replay will lead to the
filesystem containing inconsistencies that can
lead to any number of problems.
.TP
.BR data= { journal | ordered | writeback }
Specifies the journaling mode for file data. Metadata is always journaled.
To use modes other than
.B ordered
on the root filesystem, pass the mode to the kernel as boot parameter, e.g.\&
.IR rootflags=data=journal .
.RS
.TP
.B journal
All data is committed into the journal prior to being written into the
main filesystem.
.TP
.B ordered
This is the default mode. All data is forced directly out to the main file
system prior to its metadata being committed to the journal.
.TP
.B writeback
Data ordering is not preserved \(en data may be written into the main
filesystem after its metadata has been committed to the journal.
This is rumoured to be the highest-throughput option. It guarantees
internal filesystem integrity, however it can allow old data to appear
in files after a crash and journal recovery.
.RE
.TP
.B data_err=ignore
Just print an error message if an error occurs in a file data buffer in
ordered mode.
.TP
.B data_err=abort
Abort the journal if an error occurs in a file data buffer in ordered mode.
.TP
.BR barrier=0 " / " barrier=1 "
This disables / enables the use of write barriers in the jbd code. barrier=0
disables, barrier=1 enables (default). This also requires an IO stack which can
support barriers, and if jbd gets an error on a barrier write, it will disable
barriers again with a warning. Write barriers enforce proper on-disk ordering
of journal commits, making volatile disk write caches safe to use, at some
performance penalty. If your disks are battery-backed in one way or another,
disabling barriers may safely improve performance.
.TP
.BI commit= nrsec
Sync all data and metadata every
.I nrsec
seconds. The default value is 5 seconds. Zero means default.
.TP
.B user_xattr
Enable Extended User Attributes. See the
.BR attr (5)
manual page.
.TP
.B acl
Enable POSIX Access Control Lists. See the
.BR acl (5)
manual page.
.TP
.BR usrjquota=aquota.user | grpjquota=aquota.group | jqfmt=vfsv0
Apart from the old quota system (as in ext2, jqfmt=vfsold aka version 1 quota)
ext3 also supports journaled quotas (version 2 quota). jqfmt=vfsv0
enables journaled quotas. For journaled quotas the mount options
usrjquota=aquota.user and grpjquota=aquota.group are required to tell the
quota system which quota database files to use. Journaled quotas have the
advantage that even after a crash no quota check is required.
.SH "Mount options for ext4"
The ext4 filesystem is an advanced level of the ext3 filesystem which
incorporates scalability and reliability enhancements for supporting large
filesystem.
The options
.B journal_dev, norecovery, noload, data, commit, orlov, oldalloc, [no]user_xattr
.B [no]acl, bsddf, minixdf, debug, errors, data_err, grpid, bsdgroups, nogrpid
.B sysvgroups, resgid, resuid, sb, quota, noquota, grpquota, usrquota
.B usrjquota, grpjquota and jqfmt
are backwardly compatible with ext3 or ext2.
.TP
.B journal_checksum
Enable checksumming of the journal transactions. This will allow the recovery
code in e2fsck and the kernel to detect corruption in the kernel. It is a
compatible change and will be ignored by older kernels.
.TP
.B journal_async_commit
Commit block can be written to disk without waiting for descriptor blocks. If
enabled older kernels cannot mount the device.
This will enable 'journal_checksum' internally.
.TP
.BR barrier=0 " / " barrier=1 " / " barrier " / " nobarrier
These mount options have the same effect as in ext3. The mount options
"barrier" and "nobarrier" are added for consistency with other ext4 mount
options.
The ext4 filesystem enables write barriers by default.
.TP
.BI inode_readahead_blks= n
This tuning parameter controls the maximum number of inode table blocks that
ext4's inode table readahead algorithm will pre-read into the buffer cache.
The value must be a power of 2. The default value is 32 blocks.
.TP
.BI stripe= n
Number of filesystem blocks that mballoc will try to use for allocation size
and alignment. For RAID5/6 systems this should be the number of data disks *
RAID chunk size in filesystem blocks.
.TP
.B delalloc
Deferring block allocation until write-out time.
.TP
.B nodelalloc
Disable delayed allocation. Blocks are allocated when data is copied from user
to page cache.
.TP
.BI max_batch_time= usec
Maximum amount of time ext4 should wait for additional filesystem operations to
be batch together with a synchronous write operation. Since a synchronous
write operation is going to force a commit and then a wait for the I/O
complete, it doesn't cost much, and can be a huge throughput win, we wait for a
small amount of time to see if any other transactions can piggyback on the
synchronous write. The algorithm used is designed to automatically tune for
the speed of the disk, by measuring the amount of time (on average) that it
takes to finish committing a transaction. Call this time the "commit time".
If the time that the transaction has been running is less than the commit time,
ext4 will try sleeping for the commit time to see if other operations will join
the transaction. The commit time is capped by the max_batch_time, which
defaults to 15000\ \[mc]s (15\ ms). This optimization can be turned off entirely by
setting max_batch_time to 0.
.TP
.BI min_batch_time= usec
This parameter sets the commit time (as described above) to be at least
min_batch_time. It defaults to zero microseconds. Increasing this parameter
may improve the throughput of multi-threaded, synchronous workloads on very
fast disks, at the cost of increasing latency.
.TP
.BI journal_ioprio= prio
The I/O priority (from 0 to 7, where 0 is the highest priority) which should be
used for I/O operations submitted by kjournald2 during a commit operation.
This defaults to 3, which is a slightly higher priority than the default I/O
priority.
.TP
.B abort
Simulate the effects of calling ext4_abort() for
debugging purposes. This is normally used while
remounting a filesystem which is already mounted.
.TP
.BR auto_da_alloc | noauto_da_alloc
Many broken applications don't use fsync() when
replacing existing files via patterns such as
fd = open("foo.new")/write(fd,...)/close(fd)/ rename("foo.new", "foo")
or worse yet
fd = open("foo", O_TRUNC)/write(fd,...)/close(fd).
If auto_da_alloc is enabled, ext4 will detect the replace-via-rename and
replace-via-truncate patterns and force that any delayed allocation blocks are
allocated such that at the next journal commit, in the default data=ordered
mode, the data blocks of the new file are forced to disk before the rename()
operation is committed. This provides roughly the same level of guarantees as
ext3, and avoids the "zero-length" problem that can happen when a system
crashes before the delayed allocation blocks are forced to disk.
.TP
.B noinit_itable
Do not initialize any uninitialized inode table blocks in the background. This
feature may be used by installation CD's so that the install process can
complete as quickly as possible; the inode table initialization process would
then be deferred until the next time the filesystem is mounted.
.TP
.B init_itable=n
The lazy itable init code will wait n times the number of milliseconds it took
to zero out the previous block group's inode table. This minimizes the impact on
system performance while the filesystem's inode table is being initialized.
.TP
.BR discard / nodiscard
Controls whether ext4 should issue discard/TRIM commands to the underlying
block device when blocks are freed. This is useful for SSD devices and
sparse/thinly-provisioned LUNs, but it is off by default until sufficient
testing has been done.
.TP
.B nouid32
Disables 32-bit UIDs and GIDs. This is for
interoperability with older kernels which only
store and expect 16-bit values.
.TP
.BR block_validity / noblock_validity
This options allows to enables/disables the in-kernel facility for tracking
filesystem metadata blocks within internal data structures. This allows multi-\c
block allocator and other routines to quickly locate extents which might
overlap with filesystem metadata blocks. This option is intended for debugging
purposes and since it negatively affects the performance, it is off by default.
.TP
.BR dioread_lock / dioread_nolock
Controls whether or not ext4 should use the DIO read locking. If the
dioread_nolock option is specified ext4 will allocate uninitialized extent
before buffer write and convert the extent to initialized after IO completes.
This approach allows ext4 code to avoid using inode mutex, which improves
scalability on high speed storages. However this does not work with data
journaling and dioread_nolock option will be ignored with kernel warning.
Note that dioread_nolock code path is only used for extent-based files.
Because of the restrictions this options comprises it is off by default
(e.g.\& dioread_lock).
.TP
.B max_dir_size_kb=n
This limits the size of the directories so that any attempt to expand them
beyond the specified limit in kilobytes will cause an ENOSPC error. This is
useful in memory-constrained environments, where a very large directory can
cause severe performance problems or even provoke the Out Of Memory killer. (For
example, if there is only 512\ MB memory available, a 176\ MB directory may
seriously cramp the system's style.)
.TP
.B i_version
Enable 64-bit inode version support. This option is off by default.
.SH SEE ALSO
.BR mke2fs (8),
.BR mke2fs.conf (5),
.BR e2fsck (8),
.BR dumpe2fs (8),
.BR tune2fs (8),
.BR debugfs (8)
.BR debugfs (8),
.BR mount (8)

View File

@ -174,7 +174,8 @@ static int parse_version_number(const char *s)
return KERNEL_VERSION(major, minor, rev);
}
static int is_before_linux_ver(unsigned int major, unsigned int minor)
static int is_before_linux_ver(unsigned int major, unsigned int minor,
unsigned int rev)
{
struct utsname ut;
static int linux_version_code = -1;
@ -188,10 +189,11 @@ static int is_before_linux_ver(unsigned int major, unsigned int minor)
if (linux_version_code == 0)
return 0;
return linux_version_code < KERNEL_VERSION(major, minor, 0);
return linux_version_code < KERNEL_VERSION(major, minor, rev);
}
#else
static int is_before_linux_ver(unsigned int major, unsigned int minor)
static int is_before_linux_ver(unsigned int major, unsigned int minor,
unsigned int rev)
{
return 0;
}
@ -1343,6 +1345,18 @@ int get_int_from_profile(char **types, const char *opt, int def_val)
return ret;
}
static unsigned int get_uint_from_profile(char **types, const char *opt,
unsigned int def_val)
{
unsigned int ret;
char **cpp;
profile_get_uint(profile, "defaults", opt, 0, def_val, &ret);
for (cpp = types; *cpp; cpp++)
profile_get_uint(profile, "fs_types", *cpp, opt, ret, &ret);
return ret;
}
static double get_double_from_profile(char **types, const char *opt,
double def_val)
{
@ -1520,7 +1534,7 @@ profile_error:
memset(&fs_param, 0, sizeof(struct ext2_super_block));
fs_param.s_rev_level = 1; /* Create revision 1 filesystems now */
if (is_before_linux_ver(2, 2))
if (is_before_linux_ver(2, 2, 0))
fs_param.s_rev_level = 0;
if (argc && *argv) {
@ -1605,6 +1619,12 @@ profile_error:
_("flex_bg size must be a power of 2"));
exit(1);
}
if (flex_bg_size > MAX_32_NUM) {
com_err(program_name, 0,
_("flex_bg size (%lu) must be less than"
" or equal to 2^31"), flex_bg_size);
exit(1);
}
break;
case 'i':
inode_ratio = strtoul(optarg, &tmp, 0);
@ -1694,6 +1714,11 @@ profile_error:
_("bad revision level - %s"), optarg);
exit(1);
}
if (r_opt > EXT2_MAX_SUPP_REV) {
com_err(program_name, EXT2_ET_REV_TOO_HIGH,
_("while trying to create revision %d"), r_opt);
exit(1);
}
fs_param.s_rev_level = r_opt;
break;
case 's': /* deprecated */
@ -1784,7 +1809,7 @@ profile_error:
printf(_("Using journal device's blocksize: %d\n"), blocksize);
fs_param.s_log_block_size =
int_log2(blocksize >> EXT2_MIN_BLOCK_LOG_SIZE);
ext2fs_close(jfs);
ext2fs_close_free(&jfs);
}
if (optind < argc) {
@ -1972,7 +1997,7 @@ profile_error:
if (use_bsize == -1) {
use_bsize = sys_page_size;
if (is_before_linux_ver(2, 6) && use_bsize > 4096)
if (is_before_linux_ver(2, 6, 0) && use_bsize > 4096)
use_bsize = 4096;
}
if (lsector_size && use_bsize < lsector_size)
@ -2167,7 +2192,15 @@ profile_error:
blocksize, sys_page_size);
}
/*
* On newer kernels we do have lazy_itable_init support. So pick the
* right default in case ext4 module is not loaded.
*/
if (is_before_linux_ver(2, 6, 37))
lazy_itable_init = 0;
else
lazy_itable_init = 1;
if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
lazy_itable_init = 1;
@ -2272,7 +2305,7 @@ profile_error:
inode_size = get_int_from_profile(fs_types, "inode_size", 0);
if (!flex_bg_size && (fs_param.s_feature_incompat &
EXT4_FEATURE_INCOMPAT_FLEX_BG))
flex_bg_size = get_int_from_profile(fs_types,
flex_bg_size = get_uint_from_profile(fs_types,
"flex_bg_size", 16);
if (flex_bg_size) {
if (!(fs_param.s_feature_incompat &
@ -2821,7 +2854,7 @@ int main (int argc, char *argv[])
if (fs->super->s_feature_incompat &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
create_journal_dev(fs);
exit(ext2fs_close(fs) ? 1 : 0);
exit(ext2fs_close_free(&fs) ? 1 : 0);
}
if (bad_blocks_filename)
@ -2942,7 +2975,7 @@ int main (int argc, char *argv[])
}
if (!quiet)
printf("%s", _("done\n"));
ext2fs_close(jfs);
ext2fs_close_free(&jfs);
free(journal_device);
} else if ((journal_size) ||
(fs_param.s_feature_compat &
@ -3020,7 +3053,7 @@ no_journal:
"filesystem accounting information: "));
checkinterval = fs->super->s_checkinterval;
max_mnt_count = fs->super->s_max_mnt_count;
retval = ext2fs_close(fs);
retval = ext2fs_close_free(&fs);
if (retval) {
fprintf(stderr, "%s",
_("\nWarning, had trouble writing out superblocks."));

View File

@ -1209,7 +1209,7 @@ static int add_journal(ext2_filsys fs)
fflush(stdout);
retval = ext2fs_add_journal_device(fs, jfs);
ext2fs_close(jfs);
ext2fs_close_free(&jfs);
if (retval) {
com_err(program_name, retval,
_("while adding filesystem to journal on %s"),
@ -2512,7 +2512,7 @@ retry_open:
goto closefs;
}
if (io_ptr != io_ptr_orig) {
ext2fs_close(fs);
ext2fs_close_free(&fs);
goto retry_open;
}
}
@ -2805,5 +2805,5 @@ closefs:
exit(1);
}
return (ext2fs_close(fs) ? 1 : 0);
return (ext2fs_close_free(&fs) ? 1 : 0);
}

View File

@ -28,6 +28,9 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <time.h>
#include "et/com_err.h"
@ -87,7 +90,7 @@ void proceed_question(int delay)
if (delay > 0) {
if (setjmp(alarm_env)) {
signal(SIGALRM, SIG_IGN);
printf(_("<proceeding>\n"));
printf("%s", _("<proceeding>\n"));
return;
}
signal(SIGALRM, alarm_signal);
@ -137,7 +140,7 @@ static void print_ext2_info(const char *device)
tm = sb->s_wtime;
printf(_("\tlast modified on %s"), ctime(&tm));
}
ext2fs_close(fs);
ext2fs_close_free(&fs);
}
/*

View File

@ -1 +1 @@
ca cs de es fr id it nl pl sv tr vi zh_CN
ca cs de eo es fr id it nl pl sv tr uk vi zh_CN

View File

@ -21,10 +21,13 @@ my @translator_help = (
"#. on. A table of these expansions can be found below. Note that\n",
"#. %-expressions that begin with \"%D\" and \"%I\" are two-character\n",
"#. expansions; so for example, \"%Iu\" expands to the inode's user id\n",
"#. ownership field (inode->i_uid).\n",
"#. ownership field (inode->i_uid). Also the \"%B\" expansion is special:\n",
"#. it can expand to either the string \"indirect block\" (possibly preceded\n",
"#. by the word \"double\" or \"triple\"), or the string \"block #\" immediately\n",
"#. followed by an integer indicating a block sequence number.\n",
"#. \n",
"#. %b <blk> block number\n",
"#. %B <blkcount> integer\n",
"#. %B \"indirect block\" | \"block #\"<blkcount> string | string+integer\n",
"#. %c <blk2> block number\n",
"#. %Di <dirent> -> ino inode number\n",
"#. %Dn <dirent> -> name string\n",

BIN
po/ca.gmo

Binary file not shown.

660
po/ca.po

File diff suppressed because it is too large Load Diff

BIN
po/cs.gmo

Binary file not shown.

781
po/cs.po

File diff suppressed because it is too large Load Diff

BIN
po/de.gmo

Binary file not shown.

1339
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
po/eo.gmo Normal file

Binary file not shown.

6798
po/eo.po Normal file

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo

Binary file not shown.

644
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo

Binary file not shown.

780
po/fr.po

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo

Binary file not shown.

644
po/id.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

1827
po/it.po

File diff suppressed because it is too large Load Diff

BIN
po/nl.gmo

Binary file not shown.

830
po/nl.po

File diff suppressed because it is too large Load Diff

BIN
po/pl.gmo

Binary file not shown.

799
po/pl.po

File diff suppressed because it is too large Load Diff

BIN
po/sv.gmo

Binary file not shown.

826
po/sv.po

File diff suppressed because it is too large Load Diff

BIN
po/tr.gmo

Binary file not shown.

644
po/tr.po

File diff suppressed because it is too large Load Diff

BIN
po/uk.gmo Normal file

Binary file not shown.

7106
po/uk.po Normal file

File diff suppressed because it is too large Load Diff

BIN
po/vi.gmo

Binary file not shown.

804
po/vi.po

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -319,6 +319,17 @@ int main (int argc, char ** argv)
exit (1);
}
if (!(mount_flags & EXT2_MF_MOUNTED)) {
if (!force && ((fs->super->s_lastcheck < fs->super->s_mtime) ||
(fs->super->s_state & EXT2_ERROR_FS) ||
((fs->super->s_state & EXT2_VALID_FS) == 0))) {
fprintf(stderr,
_("Please run 'e2fsck -f %s' first.\n\n"),
device_name);
exit(1);
}
}
/*
* Check for compatibility with the feature sets. We need to
* be more stringent than ext2fs_open().
@ -332,13 +343,6 @@ int main (int argc, char ** argv)
min_size = calculate_minimum_resize_size(fs, flags);
if (print_min_size) {
if (!force && ((fs->super->s_state & EXT2_ERROR_FS) ||
((fs->super->s_state & EXT2_VALID_FS) == 0))) {
fprintf(stderr,
_("Please run 'e2fsck -f %s' first.\n\n"),
device_name);
exit(1);
}
printf(_("Estimated minimum size of the filesystem: %llu\n"),
min_size);
exit(0);
@ -444,14 +448,6 @@ int main (int argc, char ** argv)
bigalloc_check(fs, force);
retval = online_resize_fs(fs, mtpt, &new_size, flags);
} else {
if (!force && ((fs->super->s_lastcheck < fs->super->s_mtime) ||
(fs->super->s_state & EXT2_ERROR_FS) ||
((fs->super->s_state & EXT2_VALID_FS) == 0))) {
fprintf(stderr,
_("Please run 'e2fsck -f %s' first.\n\n"),
device_name);
exit(1);
}
bigalloc_check(fs, force);
printf(_("Resizing the filesystem on "
"%s to %llu (%dk) blocks.\n"),
@ -468,7 +464,7 @@ int main (int argc, char ** argv)
_("Please run 'e2fsck -fy %s' to fix the filesystem\n"
"after the aborted resize operation.\n"),
device_name);
ext2fs_close(fs);
ext2fs_close_free(&fs);
exit(1);
}
printf(_("The filesystem on %s is now %llu blocks long.\n\n"),

View File

@ -202,7 +202,7 @@ errcode_t resize_fs(ext2_filsys fs, blk64_t *new_size, int flags,
rfs->new_fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
print_resource_track(rfs, &overall_track, fs->io);
retval = ext2fs_close(rfs->new_fs);
retval = ext2fs_close_free(&rfs->new_fs);
if (retval)
goto errout;

View File

@ -1,4 +1,4 @@
Superblock has_journal flag is clear, but a journal inode is present.
Superblock has_journal flag is clear, but a journal is present.
Clear? yes
Pass 1: Checking inodes, blocks, and sizes

View File

@ -1,8 +1,8 @@
FSCK_OPT=-yf
[ -f "$TMPFILE" ] && rm -f $TMPFILE
TMPFILE=$test_name.tmp
> $TMPFILE
# use current directory instead of /tmp becase tmpfs doesn't support DIO
rm -f $TMPFILE
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
stat -f $TMPFILE | grep -q "Type: tmpfs"
if [ $? = 0 ]; then
@ -22,8 +22,8 @@ fi
kill_debugfs() {
trap 0
PID=$(ps -o pid,command | grep -v awk |
awk "/debugfs -w $TMPFILE/ { print \$1 }")
PID=$(ps -o pid,command | grep -v grep |
grep "debugfs -w $TMPFILE" | awk "{ print \$1 }")
[ "x$PID" != "x" ] && kill -9 $PID
}

View File

@ -1,8 +1,8 @@
FSCK_OPT=-yf
[ -f "$TMPFILE" ] && rm -f $TMPFILE
TMPFILE=$test_name.tmp
> $TMPFILE
# use current directory instead of /tmp becase tmpfs doesn't support DIO
rm -f $TMPFILE
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
stat -f $TMPFILE | grep -q "Type: tmpfs"
if [ $? = 0 ] ; then

View File

@ -2,9 +2,11 @@ DESCRIPTION="enable MMP during mke2fs"
FS_SIZE=65536
MKE2FS_DEVICE_SECTSIZE=2048
export MKE2FS_DEVICE_SECTSIZE
[ -f "$TMPFILE" ] && rm -f $TMPFILE
TMPFILE=$test_name.tmp
> $TMPFILE
# use current directory instead of /tmp becase tmpfs doesn't support DIO
rm -f $TMPFILE
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
stat -f $TMPFILE | grep -q "Type: tmpfs"
if [ $? = 0 ]; then
rm -f $TMPFILE

View File

@ -21,7 +21,7 @@ if truncate -s $SIZE_2 $TMPFILE 2> /dev/null; then
echo "using $TMPFILE" >> $LOG
else
rm $TMPFILE
export TMPFILE=$(TMPDIR=. mktemp -t $test_name.XXXXXX.tmp)
export TMPFILE=$(mktemp ./$test_name.tmp.XXXXXX)
touch $TMPFILE
echo "using $TMPFILE" >> $LOG
if ! truncate -s $SIZE_2 $TMPFILE >> $LOG 2>&1; then
@ -34,7 +34,7 @@ fi
echo $MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 >> $LOG
$MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 >> $LOG
OUT_TMP=$(mktemp -t csum-tmp.XXXXXX)
OUT_TMP=$(mktemp ${TMPDIR:-/tmp}/csum-tmp.XXXXXX)
date > $OUT_TMP
cat $E2FSCK >> $OUT_TMP

View File

@ -1,8 +1,8 @@
FSCK_OPT=-yf
[ -f "$TMPFILE" ] && rm -f $TMPFILE
TMPFILE=$test_name.tmp
> $TMPFILE
# use current directory instead of /tmp becase tmpfs doesn't support DIO
rm -f $TMPFILE
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
stat -f $TMPFILE | grep -q "Type: tmpfs"
if [ $? = 0 ] ; then

View File

@ -1,8 +1,8 @@
FSCK_OPT=-yf
[ -f "$TMPFILE" ] && rm -f $TMPFILE
TMPFILE=$test_name.tmp
> $TMPFILE
# use current directory instead of /tmp becase tmpfs doesn't support DIO
rm -f $TMPFILE
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
stat -f $TMPFILE | grep -q "Type: tmpfs"
if [ $? = 0 ]; then

View File

@ -28,9 +28,11 @@ fi
. $TEST_CONFIG
TMPFILE=$(mktemp -t e2fsprogs-tmp.XXXXXX)
test_name=`echo $test_dir | sed -e 's;.*/;;'`
TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX)
trap 'rm -f $TMPFILE ; exit' 1 2 15
if [ -f $test_dir ] ; then
exit 0;
fi

View File

@ -5,7 +5,9 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>