Merge branch 'maint' into next

bitmap-optimize
Theodore Ts'o 2008-02-10 08:03:54 -05:00
commit ef80fdc8ad
40 changed files with 4031 additions and 3293 deletions

2
README
View File

@ -1,4 +1,4 @@
This is the new version (1.40.4) of the second extended file
This is the new version (1.40.6) of the second extended file
system management programs.
From time to time, I release new versions of e2fsprogs, to fix

View File

@ -1,3 +1,40 @@
E2fsprogs 1.40.6 (February 9, 2008)
===================================
Add support for returning labels for UDF filesystems in the blkid
library.
Fix bug in the blkid library where cached filesystems was not being
flushed when opening USB devices returned the error ENOMEDIUM.
(Addresses Debian Bug: #463787)
Added logic to the blkid library to automatically choose whether a
filesystem should be mounted as ext4 or ext4dev, as appropriate.
Allow tune2fs to set and clear the test_fs flag on ext4 filesystems.
Fix a bug in e2fsck which caused it to core dump if e2fsprogs had been
configured with --enable-jbd-debug.
Document the BLKID_FILE environment variable in the libblkid man page
Programmer's Notes:
-------------------
Update e2fsprogs translation template and Vietnamese and Czech translations
Fixed various Debian packaging issues --- see debian/changelog for
details. (Addresses Debian Bugs: #436058)
Don't try to create $DESTDIR/etc/init.d as part of make install as we
don't install the init.d script (and it's not the recommended way to
start uuidd anyway). (Addresses Sourceforge Bug: #1885085)
Use thread local storage to fix a theoretical race condition if two
threads try to format an unknown error code at the same time in the
com_err library.
E2fsprogs 1.40.5 (January 27, 2008)
===================================

30
debian/changelog vendored
View File

@ -1,3 +1,33 @@
e2fsprogs (1.40.6-1) unstable; urgency=low
* New upstream release
* Add support for returning labels for UDF filesystems in the blkid
library.
* Fix bug in the blkid library where cached filesystems was not being
flushed when opening USB devices returned the error ENOMEDIUM.
(Closes: #463787)
* Add logic to the blkid library to automatically choose whether a
filesystem should be mounted as ext4 or ext4dev, as appropriate.
* Allow tune2fs to set and clear the test_fs flag on ext4 filesystems.
* Document the BLKID_FILE environment variable in the libblkid man page
* Update Vietnamese and Czech translations from the translation project
* Fix dependency problem caused by dpkg 1.14.16 (Closes: #436058)
* Use thread local storage to fix a theoretical race condition if two
threads try to format an unknown error code at the same time in
the com_err library.
-- Theodore Y. Ts'o <tytso@mit.edu> Sun, 10 Feb 2008 00:06:02 -0500
e2fsprogs (1.40.5-2) unstable; urgency=low
* Fix debian/control and debian/rules so that they work correctly
after a change in dpkg-gencontrol's behavior after version 1.14.16
of dpkg. This fixes bad version dependencies for comerr-dev,
uuid-dev and ss-dev. Thanks to Don Armstrong for the explanation and
Margarity Manterola for a proposed patch. (Closes: #463058)
-- Theodore Y. Ts'o <tytso@mit.edu> Wed, 30 Jan 2008 07:17:27 -0500
e2fsprogs (1.40.5-1) unstable; urgency=low
* New upstream release.

6
debian/control vendored
View File

@ -36,7 +36,7 @@ Description: common error description library
Package: comerr-dev
Section: libdevel
Priority: extra
Depends: libc6-dev | libc-dev, libcomerr2 (= ${binary:Version})
Depends: libc6-dev | libc-dev, libcomerr2 (= ${mainBinary})
Suggests: doc-base
Replaces: e2fslibs-dev (<< 1.33-2), libkrb5-dev (<< 1.3)
Architecture: any
@ -63,7 +63,7 @@ Description: command-line interface parsing library
Package: ss-dev
Section: libdevel
Priority: extra
Depends: libc6-dev | libc-dev, libss2 (= ${binary:Version}), comerr-dev
Depends: libc6-dev | libc-dev, libss2 (= ${mainBinary}), comerr-dev
Architecture: any
Description: command-line interface parsing library - headers and static libraries
This package includes a tool that parses a command table to generate
@ -112,7 +112,7 @@ Description: universally unique id library
Package: uuid-dev
Section: libdevel
Priority: extra
Depends: libc6-dev | libc-dev, libuuid1 (= ${binary:Version})
Depends: libc6-dev | libc-dev, libuuid1 (= ${mainBinary})
Replaces: e2fslibs-dev (<< 1.15)
Architecture: any
Description: universally unique id library - headers and static libraries

6
debian/rules vendored
View File

@ -430,11 +430,11 @@ endif
dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
-Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
DH_OPTIONS= dh_gencontrol -pcomerr-dev \
-u '-v${COMERR_VERSION}-${MAIN_VERSION}'
-u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
DH_OPTIONS= dh_gencontrol -pss-dev \
-u '-v${SS_VERSION}-${MAIN_VERSION}'
-u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
DH_OPTIONS= dh_gencontrol -puuid-dev \
-u '-v${UUID_VERSION}-${MAIN_VERSION}'
-u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb

View File

@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename libext2fs.info
@settitle The EXT2FS Library (version 1.40.5)
@settitle The EXT2FS Library (version 1.40.6)
@synindex tp fn
@comment %**end of header
@ -59,8 +59,8 @@ by the author.
@title The EXT2FS Library
@subtitle The EXT2FS Library
@subtitle Version 1.40.5
@subtitle January 2008
@subtitle Version 1.40.6
@subtitle February 2008
@author by Theodore Ts'o
@ -101,7 +101,7 @@ by the Foundation.
@top The EXT2FS Library
This manual documents the EXT2FS Library, version 1.40.5.
This manual documents the EXT2FS Library, version 1.40.6.
@end ifinfo

View File

@ -823,7 +823,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
}
#ifdef CONFIG_JBD_DEBUG
jbd_debug = getenv("E2FSCK_JBD_DEBUG");
if (jbd_debug)
if (jbd_debug) {
res = sscanf(jbd_debug, "%d", &journal_enable_debug);
if (res != 1) {
fprintf(stderr,
@ -831,6 +831,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
jbd_debug);
exit (1);
}
}
#endif
return 0;

View File

@ -1,16 +1,16 @@
Begin3
Title: EXT2 Filesystem utilities
Version: 1.40.5
Entered-date: 27Jan2008
Version: 1.40.6
Entered-date: 09Feb2008
Description: The filesystem utilities for the EXT2 filesystem, including
e2fsck, mke2fs, dumpe2fs, fsck, and others.
Keywords: utilities, fsck, filesystem, Ext2fs
Author: tytso@mit.edu (Theodore Tso)
Maintained-by: tytso@mit.edu (Theodore Tso)
Primary-site: download.sourceforge.net /pub/sourceforge/e2fsprogs
3972kB e2fsprogs-1.40.5.tar.gz
440kB e2fsprogs-libs-1.40.5.tar.gz
1kB e2fsprogs-1.40.5.lsm
3984kB e2fsprogs-1.40.6.tar.gz
440kB e2fsprogs-libs-1.40.6.tar.gz
1kB e2fsprogs-1.40.6.lsm
Alternate-site:
Platforms: linux 1.2.x/1.3.x/2.0.x/2.1.x/2.2.x/2.3.x/2.4.x/2.5.x/2.6.x
Copying-policy: GPL/LGPL

View File

@ -29,6 +29,8 @@ and is verified to still be valid before being returned to the user
(if the user has read permission on the raw block device, otherwise not).
The cache file also allows unprivileged users (normally anyone other
than root, or those not in the "disk" group) to locate devices by label/id.
The standard location of the cache file can be overridden by the
environment variable BLKID_FILE.
.P
In situations where one is getting information about a single known device,
it does not impact performance whether the cache is used or not (unless you

View File

@ -25,6 +25,7 @@
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
#include <sys/utsname.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@ -158,6 +159,109 @@ static void get_ext2_info(blkid_dev dev, struct blkid_magic *id,
blkid_set_tag(dev, "SEC_TYPE", "ext2", sizeof("ext2"));
}
/*
* Check to see if a filesystem is in /proc/filesystems.
* Returns 1 if found, 0 if not
*/
int fs_proc_check(const char *fs_name)
{
FILE *f;
char buf[80], *cp, *t;
f = fopen("/proc/filesystems", "r");
if (!f)
return (0);
while (!feof(f)) {
if (!fgets(buf, sizeof(buf), f))
break;
cp = buf;
if (!isspace(*cp)) {
while (*cp && !isspace(*cp))
cp++;
}
while (*cp && isspace(*cp))
cp++;
if ((t = strchr(cp, '\n')) != NULL)
*t = 0;
if ((t = strchr(cp, '\t')) != NULL)
*t = 0;
if ((t = strchr(cp, ' ')) != NULL)
*t = 0;
if (!strcmp(fs_name, cp)) {
fclose(f);
return (1);
}
}
fclose(f);
return (0);
}
/*
* Check to see if a filesystem is available as a module
* Returns 1 if found, 0 if not
*/
int check_for_modules(const char *fs_name)
{
struct utsname uts;
FILE *f;
char buf[1024], *cp, *t;
int i;
if (uname(&uts))
return (0);
snprintf(buf, sizeof(buf), "/lib/modules/%s/modules.dep", uts.release);
f = fopen(buf, "r");
if (!f)
return (0);
while (!feof(f)) {
if (!fgets(buf, sizeof(buf), f))
break;
if ((cp = strchr(buf, ':')) != NULL)
*cp = 0;
else
continue;
if ((cp = strrchr(buf, '/')) != NULL)
cp++;
i = strlen(cp);
if (i > 3) {
t = cp + i - 3;
if (!strcmp(t, ".ko"))
*t = 0;
}
if (!strcmp(cp, fs_name))
return (1);
}
fclose(f);
return (0);
}
static int system_supports_ext4()
{
static time_t last_check = 0;
static int ret = -1;
time_t now = time(0);
if (ret != -1 || (last_check - now) < 5)
return ret;
last_check = now;
ret = (fs_proc_check("ext4") || check_for_modules("ext4"));
return ret;
}
static int system_supports_ext4dev()
{
static time_t last_check = 0;
static int ret = -1;
time_t now = time(0);
if (ret != -1 || (last_check - now) < 5)
return ret;
last_check = now;
ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));
return ret;
}
static int probe_ext4dev(struct blkid_probe *probe,
struct blkid_magic *id,
unsigned char *buf)
@ -165,10 +269,6 @@ static int probe_ext4dev(struct blkid_probe *probe,
struct ext2_super_block *es;
es = (struct ext2_super_block *)buf;
/* Distinguish between ext4dev and other filesystems */
if ((blkid_le32(es->s_flags) & EXT2_FLAGS_TEST_FILESYS) == 0)
return -BLKID_ERR_PARAM;
/* Distinguish from jbd */
if (blkid_le32(es->s_feature_incompat) &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
@ -179,6 +279,22 @@ static int probe_ext4dev(struct blkid_probe *probe,
EXT3_FEATURE_COMPAT_HAS_JOURNAL))
return -BLKID_ERR_PARAM;
/*
* If the filesystem is marked as OK for use by in-development
* filesystem code, but ext4dev is not supported, and ext4 is,
* then don't call ourselves ext4dev, since we should be
* detected as ext4 in that case.
*
* If the filesystem is marked as in use by production
* filesystem, then it can only be used by ext4 and NOT by
* ext4dev, so always disclaim we are ext4dev in that case.
*/
if (blkid_le32(es->s_flags) & EXT2_FLAGS_TEST_FILESYS) {
if (!system_supports_ext4dev() && system_supports_ext4())
return -BLKID_ERR_PARAM;
} else
return -BLKID_ERR_PARAM;
get_ext2_info(probe->dev, id, buf);
return 0;
}
@ -189,10 +305,6 @@ static int probe_ext4(struct blkid_probe *probe, struct blkid_magic *id,
struct ext2_super_block *es;
es = (struct ext2_super_block *)buf;
/* Distinguish from ext4dev */
if (blkid_le32(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)
return -BLKID_ERR_PARAM;
/* Distinguish from jbd */
if (blkid_le32(es->s_feature_incompat) &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
@ -210,6 +322,20 @@ static int probe_ext4(struct blkid_probe *probe, struct blkid_magic *id,
EXT3_FEATURE_INCOMPAT_UNSUPPORTED))
return -BLKID_ERR_PARAM;
/*
* If the filesystem is a OK for use by in-development
* filesystem code, and ext4dev is supported or ext4 is not
* supported, then don't call ourselves ext4, so we can redo
* the detection and mark the filesystem as ext4dev.
*
* If the filesystem is marked as in use by production
* filesystem, then it can only be used by ext4 and NOT by
* ext4dev.
*/
if (blkid_le32(es->s_flags) & EXT2_FLAGS_TEST_FILESYS) {
if (system_supports_ext4dev() || !system_supports_ext4())
return -BLKID_ERR_PARAM;
}
get_ext2_info(probe->dev, id, buf);
return 0;
}
@ -780,7 +906,7 @@ static int probe_udf(struct blkid_probe *probe,
NSR02 for UDF 1.50
NSR03 for UDF 2.00 */
if (!memcmp(isosb->vd_id, "NSR0", 4))
return 0;
return probe_iso9660(probe, id, buf);
for (m = udf_magic; *m; m++)
if (!memcmp(*m, isosb->vd_id, 5))
break;
@ -1030,7 +1156,7 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
if (((probe.fd = open(dev->bid_name, O_RDONLY)) < 0) ||
(fstat(probe.fd, &st) < 0)) {
if (probe.fd >= 0) close(probe.fd);
if (errno == ENXIO || errno == ENODEV || errno == ENOENT) {
if (errno != EPERM) {
blkid_free_dev(dev);
return NULL;
}

BIN
lib/blkid/tests/udf.img.bz2 Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
TYPE='udf'
LABEL='test-udf'

View File

@ -38,7 +38,13 @@
#include "error_table.h"
#include "internal.h"
static char buffer[25];
#ifdef TLS
#define THREAD_LOCAL static TLS
#else
#define THREAD_LOCAL static
#endif
THREAD_LOCAL char buffer[25];
struct et_list * _et_list = (struct et_list *) NULL;
struct et_list * _et_dynamic_list = (struct et_list *) NULL;

View File

@ -251,8 +251,7 @@ installdirs:
$(DESTDIR)$(root_sbindir) $(DESTDIR)$(bindir) \
$(DESTDIR)$(man1dir) $(DESTDIR)$(man8dir) \
$(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) \
$(DESTDIR)$(libdir) $(DESTDIR)/$(root_sysconfdir) \
$(DESTDIR)/etc/init.d
$(DESTDIR)$(libdir) $(DESTDIR)/$(root_sysconfdir)
install: all $(SMANPAGES) $(UMANPAGES) installdirs
@for i in $(SPROGS); do \

View File

@ -55,6 +55,16 @@ extern int optind;
#include "../version.h"
#include "nls-enable.h"
/*
* Tune2fs supports these features in addition to the standard features.
*/
#define EXT2_TUNE2FS_INCOMPAT (EXT3_FEATURE_INCOMPAT_EXTENTS)
#define EXT2_TUNE2FS_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\
EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE)
const char * program_name = "tune2fs";
char * device_name;
char * new_label, *new_last_mounted, *new_UUID;
@ -475,8 +485,9 @@ static void parse_e2label_options(int argc, char ** argv)
argv[1]);
exit(1);
}
open_flag = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_JOURNAL_DEV_OK;
if (argc == 3) {
open_flag = EXT2_FLAG_RW | EXT2_FLAG_JOURNAL_DEV_OK;
open_flag |= EXT2_FLAG_RW;
L_flag = 1;
new_label = argv[2];
} else
@ -519,6 +530,8 @@ static void parse_tune2fs_options(int argc, char **argv)
struct group * gr;
struct passwd * pw;
open_flag = EXT2_FLAG_SOFTSUPP_FEATURES;
printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:E:J:L:M:O:T:U:")) != EOF)
switch (c)
@ -565,7 +578,7 @@ static void parse_tune2fs_options(int argc, char **argv)
break;
case 'E':
extended_cmd = optarg;
open_flag = EXT2_FLAG_RW;
open_flag |= EXT2_FLAG_RW;
break;
case 'f': /* Force */
f_flag = 1;
@ -637,7 +650,7 @@ static void parse_tune2fs_options(int argc, char **argv)
case 'L':
new_label = optarg;
L_flag = 1;
open_flag = EXT2_FLAG_RW |
open_flag |= EXT2_FLAG_RW |
EXT2_FLAG_JOURNAL_DEV_OK;
break;
case 'm':
@ -758,6 +771,12 @@ void do_findfs(int argc, char **argv)
exit(0);
}
/*
* Note! If any extended options are incompatible with the
* intersection of the SOFTSUPP features and those features explicitly
* enabled for tune2fs, there needs to be an explicit test for them
* here.
*/
static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
char *buf, *token, *next, *p, *arg;
@ -851,6 +870,13 @@ int main (int argc, char ** argv)
}
sb = fs->super;
fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
if ((sb->s_feature_incompat & !EXT2_TUNE2FS_INCOMPAT) ||
(sb->s_feature_ro_compat & !EXT2_TUNE2FS_RO_COMPAT)) {
fprintf(stderr,
_("Filesystem %s has unsupported features enabled.\n"),
device_name);
exit(1);
}
if (print_label) {
/* For e2label emulation */
printf("%.*s\n", (int) sizeof(sb->s_volume_name),

BIN
po/ca.gmo

Binary file not shown.

352
po/ca.po

File diff suppressed because it is too large Load Diff

BIN
po/cs.gmo

Binary file not shown.

2432
po/cs.po

File diff suppressed because it is too large Load Diff

BIN
po/de.gmo

Binary file not shown.

362
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/es.gmo

Binary file not shown.

366
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo

Binary file not shown.

368
po/fr.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

373
po/it.po

File diff suppressed because it is too large Load Diff

BIN
po/nl.gmo

Binary file not shown.

596
po/nl.po

File diff suppressed because it is too large Load Diff

BIN
po/pl.gmo

Binary file not shown.

479
po/pl.po

File diff suppressed because it is too large Load Diff

BIN
po/sv.gmo

Binary file not shown.

515
po/sv.po

File diff suppressed because it is too large Load Diff

BIN
po/tr.gmo

Binary file not shown.

367
po/tr.po

File diff suppressed because it is too large Load Diff

BIN
po/vi.gmo

Binary file not shown.

460
po/vi.po

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,9 @@
# Test script for e2fsck
#
LC_ALL=C
export LC_ALL
case "$1" in
--valgrind)
export USE_VALGRIND="valgrind -q --weird-hacks=lax-ioctls"

View File

@ -7,5 +7,5 @@
* redistributed under the GNU Public License.
*/
#define E2FSPROGS_VERSION "1.40.5"
#define E2FSPROGS_DATE "27-Jan-2008"
#define E2FSPROGS_VERSION "1.40.6"
#define E2FSPROGS_DATE "09-Feb-2008"