aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-05-16 11:05:37 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-05-16 11:05:37 -0400
commit29f6dfea52f7c3d6e90b9a03fb66fc09d4aa90ed (patch)
treeebb8c3c4a188b14f4481d20c1c73d540bf06f7dc
parent07bcd90f3dab9a7907081dc455e089f92b9dd0a1 (diff)
parent25399080c5b100fe7499334c30184592d68bc99d (diff)
downloade2fsprogs-29f6dfea52f7c3d6e90b9a03fb66fc09d4aa90ed.tar.gz
e2fsprogs-29f6dfea52f7c3d6e90b9a03fb66fc09d4aa90ed.tar.xz
e2fsprogs-29f6dfea52f7c3d6e90b9a03fb66fc09d4aa90ed.zip
Merge branch 'maint' into next
-rwxr-xr-xconfigure36
-rw-r--r--e2fsck/journal.c14
-rw-r--r--e2fsck/pass1.c2
-rw-r--r--misc/chattr.1.in4
-rw-r--r--tests/f_zero_xattr/expect.17
-rw-r--r--tests/f_zero_xattr/image.gzbin0 -> 707 bytes
-rw-r--r--tests/f_zero_xattr/name1
-rw-r--r--tests/f_zero_xattr/script2
8 files changed, 61 insertions, 5 deletions
diff --git a/configure b/configure
index 84e7e03e..ed0103f6 100755
--- a/configure
+++ b/configure
@@ -640,6 +640,7 @@ LINUX_CMT
UNI_DIFF_OPTS
SEM_INIT_LIB
SOCKET_LIB
+SIZEOF_OFF_T
SIZEOF_LONG_LONG
SIZEOF_LONG
SIZEOF_INT
@@ -10651,10 +10652,45 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
SIZEOF_SHORT=$ac_cv_sizeof_short
SIZEOF_INT=$ac_cv_sizeof_int
SIZEOF_LONG=$ac_cv_sizeof_long
SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
+SIZEOF_OFF_T=$ac_cv_sizeof_off_t
+
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 59ccc0e6..fd6d6caa 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -419,9 +419,19 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
#ifndef USE_INODE_IO
if (ext_journal)
#endif
- retval = io_ptr->open(journal_name,
- IO_FLAG_RW | IO_FLAG_EXCLUSIVE,
+ {
+ int flags = IO_FLAG_RW;
+ if (!(ctx->mount_flags & EXT2_MF_ISROOT &&
+ ctx->mount_flags & EXT2_MF_READONLY))
+ flags |= IO_FLAG_EXCLUSIVE;
+ if ((ctx->mount_flags & EXT2_MF_READONLY) &&
+ (ctx->options & E2F_OPT_FORCE))
+ flags &= ~IO_FLAG_EXCLUSIVE;
+
+
+ retval = io_ptr->open(journal_name, flags,
&ctx->journal_io);
+ }
if (retval)
goto errout;
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index a20b57bb..94df36d4 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -307,7 +307,7 @@ static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx)
remain -= EXT2_EXT_ATTR_SIZE(entry->e_name_len);
/* check value size */
- if (entry->e_value_size == 0 || entry->e_value_size > remain) {
+ if (entry->e_value_size > remain) {
pctx->num = entry->e_value_size;
problem = PR_1_ATTR_VALUE_SIZE;
goto fix;
diff --git a/misc/chattr.1.in b/misc/chattr.1.in
index 64aab7ba..932ef4bc 100644
--- a/misc/chattr.1.in
+++ b/misc/chattr.1.in
@@ -168,8 +168,8 @@ 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
-by the ext2 and ext3 filesystems as implemented in the current mainline
-Linux kernels.
+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.
.PP
diff --git a/tests/f_zero_xattr/expect.1 b/tests/f_zero_xattr/expect.1
new file mode 100644
index 00000000..0733af6e
--- /dev/null
+++ b/tests/f_zero_xattr/expect.1
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/24 files (0.0% non-contiguous), 25/200 blocks
+Exit status is 0
diff --git a/tests/f_zero_xattr/image.gz b/tests/f_zero_xattr/image.gz
new file mode 100644
index 00000000..40055520
--- /dev/null
+++ b/tests/f_zero_xattr/image.gz
Binary files differ
diff --git a/tests/f_zero_xattr/name b/tests/f_zero_xattr/name
new file mode 100644
index 00000000..52aab152
--- /dev/null
+++ b/tests/f_zero_xattr/name
@@ -0,0 +1 @@
+zero length extended attribute in in-inode xattr
diff --git a/tests/f_zero_xattr/script b/tests/f_zero_xattr/script
new file mode 100644
index 00000000..8ab2b9c6
--- /dev/null
+++ b/tests/f_zero_xattr/script
@@ -0,0 +1,2 @@
+ONE_PASS_ONLY="true"
+. $cmd_dir/run_e2fsck