For the 1.43 release, quota support will be the default. It's much
simpler if we don't try to make quota support optional. This was done
originally because the quota feature wasn't fully tested. It is now,
so we can remove this as an option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some newer versions of autoconf kvetch if we are still using
configure.in. As of this writing the only version of autoconf which I
support is autoconf 2.69, and if you try to recreate the configure
script which is shipped with e2fsprogs, and it breaks, you get to keep
both pieces.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This is the initial implementation of a FUSE server based on
e2fsprogs. The point of this program is to enable ext4 to run on any
OS that FUSE supports (and doesn't already have a native driver), such
as MacOS X, BSDs, and Windows. The code requires FUSE API v28, which
is available in Linux fuse and osxfuse releases that are available as
of August 2013.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Move other C compiler flags to ALL_CFLAGS so that CFLAGS only controls
the debugging and optimization flags. This allows a developer to
build with "make CFLAGS=-g" in order to compile w/o optimization.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If we're using check_plausibility() to try to identify something that
obviously isn't an ext* filesystem and libblkid doesn't know what it
is, try libmagic instead.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Create a journal.c with routines adapted from e2fsck/journal.c to
handle opening and closing the journal, and setting up the
descriptors, and all that. Unlike e2fsck's versions which try to
identify and fix problems, the routines here have no way to repair
anything.
[ Modified by tytso to fold debugfs/jfs_user.h into e2fsck/jfs_user.h,
so we don't have to copy recovery.c and revoke.c into debugfs. --tytso ]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Commit 2500ebfc89 (util: fix make dependencies for subst) broke cross
compilation because it unconditionally used config.h without setting a
includes path so that the config.h file could be found.
The proposed fix of adding the include path (such as was proposed at
http://patchwork.ozlabs.org/patch/355662/ or in Debian Bug #753375)
isn't really the right way to go, since the information in config.h is
for the target environment, and not the build environment. So using
config.h when building helper programs used as part of the build can
potentially cause more problems than it solves.
In general, build helpers must be written to be as portable as
possible, and to not require any autoconf defined #ifdef's whenever
possible. The subst program broke this rule to (1) address a Coverity
security complaint by using futimes(2) instad of utimes(2) if present,
and (2) to preserve the nanosecond portion of the file timestamp.
Oh, well. We won't be able to do the latter when cross compiling, and
as to the former, if an attacker has write access to your build tree
while you are building programs that will be run as root, you've got
bigger problems. :-)
Fix the problem that commit 2500ebfc89 was trying to address by
explicitly adding @DEFS@ to CFLAGS, so that -DHAVE_CONFIG_H is passed
to make depend. This fixes up the make depend without forcing the use
of config.h when cross-compiling.
Addresses-Debian-Bug: #753375
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Helmut Grohne <helmut@subdivi.de>
Cc: 753375@bugs.debian.org
Per http://www.gnu.org/software/checker/ the gcc "-checker" option
is long deprecated. Nuke it from e2fsprogs.
Most people would never hit this, but people who love to turn knobs,
such as the reporter of kernel.org bz#74171, might run into it and be
sad.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fix some minor bugs relating to passing CFLAGS to cppcheck, and
package the cppcheck output into nicer looking reports.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Adding the pkgconfigdir variable allows specifying an installation
location for pkg-config files independent of libdir.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
To check the coverage of e2fsprogs's regression test, do the
following:
configure --enable-gcov
make -j8 ; make -j8 check ; make coverage.txt
The coverage information will be the coverage.txt and *.gcov files in
the build directories.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Newer versions of autoconf pull in AC_PROG_GCC as part of
AC_CANONICAL_HOST. So we need check for WITH_DIET_LIBC earlier in
configure.in.
Also, e2fsprogs now needs functions which are found in diet libc's
compat library. So add support for autoconf's LIBS function, and
automatically set libs to include -lcompat.
Finally, disable compiling e4defrag by deault if --with-diet-libc is
specified because the program has too many glibc dependencies.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Commit 832cb612: "e2fsprogs: add (optional) sparse checking to the
build" breaks systems that are not using GNU make. In addition, it
breaks if the developer tries to build in a subdirectory (i.e., if he
or she tries running "make" in the misc or e2fsck or lib/ext2fs
directory), since CHECK_CMD is not set.
Fix this by moving the sparse setup to MCONFIG.
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The Build Log Hardening Check is a debian tool which scans the output
of a package build making sure that the security hardening flags are
used when compiling and linking all of binaries in a package.
For the most part we were passing CFLAGS, CPPFLAGS, and LDFLAGS down
to the compiler and link commands, but there there were one or two
exceptions. In addition, there where a few places in "make install"
where the V=1 option was not being honored, which triggered blhc
warnings since it couldn't analyze those commands.
The e2fsck.static was the only binary that was not getting built and
packaged with the hardening flags, but I've fixed all of the blhc
warnings so in the future it will be obvious if we regress.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add a configure option, --enable-relative-symlinks, which will use
relative symlinks for the ELF shared library files.
Addresses-Sourceforge-Bug: #3520767
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Since the libquota library has namespace contamination issues, don't
build a shared library and link against it statically. Don't include
it as part of the Debian packages.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn. It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.
So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.
In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This patch adds the quota library (ported form Jan Kara's quota-tools) in
e2fsprogs in order to make quotas as a first class supported feature in Ext4.
This patch also provides interface in lib/quota/mkquota.h that will be used by
mke2fs, tune2fs, e2fsck, etc. to initialize and update quota files.
This first version of the quota library does not support reading existing quota
files. This support will be added in the near future.
Thanks to Jan Kara for his work on quota-tools. Most of the files in this patch
are taken as-is from quota tools and were simply modified to work with
libext2fs in e2fsprogs.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The dependency definitions for DEPSTATIC_LIBBLKID and
DEPPROFILED_LIBBLKID incorrectly referenced the non-dependency macros
(i.e., STATIC_LIBUUID instead of DEPSTATIC_LIBUUID). This resulted in
-luuid showing up as a Makefile dependency, which is of course wrong.
Addresses-Debian-Bug: #604629
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.
Addresses-Sourceforge-Bug: #1436294
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If gmake is available, the developer can use "make V=1" instead of
using a configure-time switch, --enable-verbose-makecmds, to see all
of the commands executed by the Makefile.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.
(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.
Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.
Addresses-Sourceforge-Patches: #2813809
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The MCONFIG.in file used $(LIBUUID) in the definition of DEPLIBBLKID,
when it should have used $(DEPLIBUUID) instead.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add an option to switch between the private (in-tree) libuuid and
public (in-system installed) library. The private version is still
enabled by default.
Signed-off-by: Scott James Remnant <scott@netsplit.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library. The private version is still
enabled by default.
If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
It's been a while since I've done a build using "configure
--enable-profile", and some bitrot had set into the Makefiles...
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads. Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.
This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library. Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.
The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces. I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock(). Threaded
applications shouldn't be using these interfaces in any case.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
... especially when using ELF shared libraries. We only need to link
with a library if the executable uses that library directly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.
Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.
Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.
Addresses-Sourceforge-Bug: #2088537
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
$(LIBSS) should automatically include @DLOPEN_LIB@ so the right thing
happens for programs that need to use the ss library.
Reorder the library link order for tst_extents since the blkid library
uses libuuid functions.
Thanks to Eric Sandeen for pointing this problem out!
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fedora and Red Hat puts the devmapper library in different locations
compared to Debian, so we use pkg-config. Unfortunately Debian's
devmapper.pc file is buggy (See Debian Bug #390243), so we have to
work around it.
Historically, e2fsprogs has tried not to depend on pkg-config, since
its answers are so often **wrong** (the Debian bug has been ignored
for over a year), so I'm hoping I'm not going to regret this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
On systems where is multi-path storage device is problem with duplicated
filesystems. The solution is select "the best" device. This is possible
by device-mapper library.
Short quotation from RH bugzilla:
With my patch, all dm devices remains in libblkid cache.
Only the top level dm devices are given high priority
and more appropriate node names (i.e. /dev/mapper/*) are used.
For example, if we have linear mapped dm device "ov1" over
dm device "disk1p3" which is multipath mapped to /dev/sdd3 and /dev/sdh3:
# dmsetup.static ls --tree
ov1 (253:5) <-- /dev/mapper/ov1 or /dev/dm-5
`-disk1p3 (253:4) <-- /dev/mapper/disk1p3 or /dev/dm-4
`-disk1 (253:0)
|- (8:112) <-- /dev/sdh
`- (8:48) <-- /dev/sdd
Original version of blkid will show:
# ./orig/blkid -t LABEL=mpdisk1p3 -l
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
With my patch, blkid will show:
# ./deptree/blkid -t LABEL=mpdisk1p3 -l
/dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
In blkid cache, all devices are listed:
# ./orig/blkid -t LABEL=mpdisk1p3
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-5: LABEL="mpdisk1p3" ... TYPE="ext3"
# ./deptree/blkid -t LABEL=mpdisk1p3
/dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
/dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
For more details see discussion on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156324
Addresses Red Hat Bug: #156324
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Use BUILD_CCFLAGS and BUILD_LDFLAGS instead of CCFLAGS and LDFLAGS in
the build system when building files in the util directory which are
needed during the build process. This avoids potential problems when
cross-compiling some of the options are not recognized as valid by the
host compiler. (Addresses Sourceforge Bug #1261547)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>