diff --git a/SOURCES/e2fsprogs-1.42.9-chattr-manpage-j-update.patch b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-j-update.patch new file mode 100644 index 0000000..2895641 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-j-update.patch @@ -0,0 +1,38 @@ +commit c7c3775443ecd01ade5500e09191c5c4e94c2b56 +Author: Zheng Liu +Date: Wed Feb 12 12:28:29 2014 -0500 + + chattr: improve the description for 'j' option in manpage + + Ext4 file system also supports to set/clear 'j' attribute, but it just + say that this option is only useful for ext3 in manpage. This commit + fixes it. + + Signed-off-by: Zheng Liu + Signed-off-by: "Theodore Ts'o" + Reviewed-by: Carlos Maiolino + +diff --git a/misc/chattr.1.in b/misc/chattr.1.in +index 932ef4b..2a3640c 100644 +--- a/misc/chattr.1.in ++++ b/misc/chattr.1.in +@@ -112,8 +112,8 @@ 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 +-journal before being written to the file itself, if the filesystem is +-mounted with the "data=ordered" or "data=writeback" options. When the ++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 + is already journalled and this attribute has no effect. Only + the superuser or a process possessing the CAP_SYS_RESOURCE +@@ -171,7 +171,7 @@ 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. ++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. + .SH AVAILABILITY diff --git a/SOURCES/e2fsprogs-1.42.9-chattr-manpage-reorder.patch b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-reorder.patch new file mode 100644 index 0000000..90ff8f5 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-reorder.patch @@ -0,0 +1,179 @@ +commit 5b9aaae742a79ef6001e58e5031b5f6ec03fe1ad +Author: Eric Sandeen +Date: Fri Jul 4 23:02:59 2014 -0400 + + e2fsprogs: reorder flags in chattr(1) + + The flags described in chattr usage() and the chattr(1) manpage + were in semi-random order, which makes it hard to ascertain + which flags might be missing or undocumented, and to locate + flags within the manpage. + + Re-order the list of flags in alphanumeric order, and do + the same for the flag descriptions in the body of the manpage. + + There should be no content changes here, just reordering + for consistency. + + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + Reviewed-by: Andreas Dilger + +diff --git a/misc/chattr.1.in b/misc/chattr.1.in +index 2a3640c..ce426e8 100644 +--- a/misc/chattr.1.in ++++ b/misc/chattr.1.in +@@ -19,24 +19,36 @@ 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. + .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), ++compression raw access (X), ++and compressed dirty file (Z). + .SH OPTIONS + .TP + .B \-R +@@ -51,14 +63,14 @@ Suppress most error messages. + .BI \-v " version" + Set the file's version/generation number. + .SH ATTRIBUTES +-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 ++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 `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 +@@ -74,27 +86,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 + .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). +@@ -111,6 +117,12 @@ 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 ++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 +@@ -127,6 +139,13 @@ 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. + .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. + This is a hint to the block allocator used by ext3 and ext4 that the +@@ -137,13 +156,6 @@ 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 + 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 +diff --git a/misc/chattr.c b/misc/chattr.c +index 39a6016..d5a6a61 100644 +--- a/misc/chattr.c ++++ b/misc/chattr.c +@@ -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] [-+=aAcCdDeijsSu] [-v version] files...\n"), + program_name); + exit(1); + } diff --git a/SOURCES/e2fsprogs-1.42.9-chattr-manpage-update.patch b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-update.patch new file mode 100644 index 0000000..14de408 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-chattr-manpage-update.patch @@ -0,0 +1,191 @@ +commit 272258e1dffe8afb6c9d0b0ba5edc119dbf9f52a +Author: Eric Sandeen +Date: Fri Jul 4 23:03:14 2014 -0400 + + e2fsprogs: revise and extend chattr(1) and chattr usage() + + The chattr(1) manpage and chattr usage() output were missing some flags. + + Add those, and make some other minor cosmetic fixes. + + (I've left out the 'B' (EXT2_COMPRBLK_FL) flag, because + it's not actually used anywhere, and I can't figure out + how it differs from 'c' (EXT2_COMPR_FL)) + + Also, because the matrix of filesystems & flags is quite large, + refer to filesystem-specific manpages for detailed discussion + of flags supported by those filesystems, rather than trying to + cover it all in this manpage. I'll send those manpage + updates to the appropriate lists a bit later. + + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + Reviewed-by: Andreas Dilger + +diff --git a/misc/chattr.1.in b/misc/chattr.1.in +index ce426e8..23b6938 100644 +--- a/misc/chattr.1.in ++++ b/misc/chattr.1.in +@@ -21,11 +21,11 @@ changes the file attributes on a Linux file system. + .PP + 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 `aAcCdDeijsStTu' select the new attributes for the files: ++The letters 'aAcCdDeijsStTu' select the new attributes for the files: + append only (a), + no atime updates (A), + compressed (c), +@@ -47,8 +47,17 @@ 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 +@@ -63,7 +72,7 @@ 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. ++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 +@@ -71,7 +80,7 @@ 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 `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 +@@ -86,13 +95,13 @@ 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 +-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 +-When a directory with the `D' attribute set is modified, ++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. ++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 +@@ -112,7 +121,7 @@ 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. +@@ -123,7 +132,7 @@ is being indexed using hashed trees. It may not be set or reset using + 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 ++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 +@@ -131,13 +140,19 @@ 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 +@@ -156,13 +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 +-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 +@@ -179,16 +194,19 @@ although it can be displayed by + was written by Remy Card . It is currently being + maintained by Theodore Ts'o . + .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). +diff --git a/misc/chattr.c b/misc/chattr.c +index d5a6a61..f130108 100644 +--- a/misc/chattr.c ++++ b/misc/chattr.c +@@ -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); + } diff --git a/SOURCES/e2fsprogs-1.42.9-dont-require-fsck-for-resize-p.patch b/SOURCES/e2fsprogs-1.42.9-dont-require-fsck-for-resize-p.patch new file mode 100644 index 0000000..bd83c4e --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-dont-require-fsck-for-resize-p.patch @@ -0,0 +1,59 @@ +commit 0462fd6db55de28d7e087d8d06ab20339acd8f67 +Author: Eric Sandeen +Date: Sun Dec 14 19:08:59 2014 -0500 + + resize2fs: don't require fsck to print min size + + My previous change ended up requiring that the filesystem + be fsck'd after the last mount, even if we are only querying + the minimum size. This is a bit draconian, and it burned + the Fedora installer, which wants to calculate minimum size + for every filesystem in the box at install time, which in turn + requires a full fsck of every filesystem. + + Try this one more time, and separate out the tests to make things + a bit more clear. If we're only printing the min size, don't + require the fsck, as this is a bit less dangerous/critical. + + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + +Index: e2fsprogs-1.42.9/resize/main.c +=================================================================== +--- e2fsprogs-1.42.9.orig/resize/main.c ++++ e2fsprogs-1.42.9/resize/main.c +@@ -319,10 +319,30 @@ 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))) { ++ /* ++ * Before acting on an unmounted filesystem, make sure it's ok, ++ * unless the user is forcing it. ++ * ++ * We do ERROR and VALID checks even if we're only printing the ++ * minimimum size, because traversal of a badly damaged filesystem ++ * can cause issues as well. We don't require it to be fscked after ++ * the last mount time in this case, though, as this is a bit less ++ * risky. ++ */ ++ if (!force && !(mount_flags & EXT2_MF_MOUNTED)) { ++ int checkit = 0; ++ ++ if (fs->super->s_state & EXT2_ERROR_FS) ++ checkit = 1; ++ ++ if ((fs->super->s_state & EXT2_VALID_FS) == 0) ++ checkit = 1; ++ ++ if ((fs->super->s_lastcheck < fs->super->s_mtime) && ++ !print_min_size) ++ checkit = 1; ++ ++ if (checkit) { + fprintf(stderr, + _("Please run 'e2fsck -f %s' first.\n\n"), + device_name); diff --git a/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-attrs.patch b/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-attrs.patch new file mode 100644 index 0000000..268f08f --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-attrs.patch @@ -0,0 +1,67 @@ +commit e92beaac1017b5cc6a73ddb88aeab7b33f714e8b +Author: Eric Sandeen +Date: Mon Aug 25 21:02:18 2014 -0400 + + e2fsprogs: add supported file attributes to ext4.5 manpage + + The chattr(1) manpage now refers users to filesystem-specific + manpages for details on supported attributes, so add those to + ext4.5. + + I've left out oddities like being able to set the compressed + or no-tail-packing flags, or setting data journaling on ext2. + + That behavior seems like a bug, not a feature. + + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + +diff --git a/misc/ext4.5.in b/misc/ext4.5.in +index 9112b3d..a862a34 100644 +--- a/misc/ext4.5.in ++++ b/misc/ext4.5.in +@@ -608,6 +608,37 @@ seriously cramp the system's style.) + .B i_version + Enable 64-bit inode version support. This option is off by default. + ++.SH FILE ATTRIBUTES ++The ext2, ext3, and ext4 filesystems support setting the following file ++attributes on Linux systems using the ++.BR chattr (1) ++utility: ++.sp ++.BR a " - append only" ++.sp ++.BR A " - no atime updates" ++.sp ++.BR d " - no dump" ++.sp ++.BR D " - synchronous directory updates" ++.sp ++.BR i " - immutable" ++.sp ++.BR S " - synchronous updates" ++.sp ++.BR u " - undeletable" ++.sp ++In addition, the ext3 and ext4 filesystems support the following flag: ++.sp ++.BR j " - data journaling" ++.sp ++Finally, the ext4 filesystem also supports the following flag: ++.sp ++.BR e " - extents format" ++.sp ++For descriptions of these attribute flags, please refer to the ++.BR chattr (1) ++man page. + .SH SEE ALSO + .BR mke2fs (8), + .BR mke2fs.conf (5), +@@ -615,4 +646,5 @@ Enable 64-bit inode version support. This option is off by default. + .BR dumpe2fs (8), + .BR tune2fs (8), + .BR debugfs (8), +-.BR mount (8) ++.BR mount (8), ++.BR chattr (1) diff --git a/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-mountopts.patch b/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-mountopts.patch new file mode 100644 index 0000000..156d146 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-ext4-manpage-add-mountopts.patch @@ -0,0 +1,394 @@ +commit 3e500a8f116b0515d1507fe0ab4bf617664a6cdc +Author: Eric Sandeen +Date: Fri Jul 4 23:07:36 2014 -0400 + + e2fsprogs: add mount options to ext4.5 + + This is a straight cut and paste from the util-linux + mount manpage to ext4.5 (with commented-out lines + removed). + + It's pretty much impossible for util-linux to keep up + with every filesystem out there, and Karel has more than + once expressed a wish that mount options move into fs-specific + manpages. + + So, here we go. + + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + +diff --git a/misc/ext4.5.in b/misc/ext4.5.in +index 134c19f..9112b3d 100644 +--- a/misc/ext4.5.in ++++ b/misc/ext4.5.in +@@ -251,10 +251,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) diff --git a/SOURCES/e2fsprogs-1.42.9-fix-endian-handling-of-ext3_extent_header.patch b/SOURCES/e2fsprogs-1.42.9-fix-endian-handling-of-ext3_extent_header.patch new file mode 100644 index 0000000..4aa3dd8 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-fix-endian-handling-of-ext3_extent_header.patch @@ -0,0 +1,45 @@ +[PATCH 2/6] e2fsprogs: fix endian handling of ext3_extent_header + +This turned up when trying to resize a filesystem containing +a file with many extents on PPC64. + +Fix all locations where ext3_extent_header members aren't +handled in an endian-safe manner. + +(Note: inline data portion removed for rhel7 application) + +Signed-off-by: Eric Sandeen +Reviewed-by: Darrick J. Wong +--- + lib/ext2fs/ext3_extents.h | 15 ++++++++++----- + 2 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/lib/ext2fs/ext3_extents.h b/lib/ext2fs/ext3_extents.h +index 4163436..a18d705 100644 +--- a/lib/ext2fs/ext3_extents.h ++++ b/lib/ext2fs/ext3_extents.h +@@ -106,15 +106,20 @@ struct ext3_ext_path { + ((struct ext3_extent_idx *) (((char *) (__hdr__)) + \ + sizeof(struct ext3_extent_header))) + #define EXT_HAS_FREE_INDEX(__path__) \ +- ((__path__)->p_hdr->eh_entries < (__path__)->p_hdr->eh_max) ++ (ext2fs_le16_to_cpu((__path__)->p_hdr->eh_entries) < \ ++ ext2fs_le16_to_cpu((__path__)->p_hdr->eh_max)) + #define EXT_LAST_EXTENT(__hdr__) \ +- (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_entries - 1) ++ (EXT_FIRST_EXTENT((__hdr__)) + \ ++ ext2fs_le16_to_cpu((__hdr__)->eh_entries) - 1) + #define EXT_LAST_INDEX(__hdr__) \ +- (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_entries - 1) ++ (EXT_FIRST_INDEX((__hdr__)) + \ ++ ext2fs_le16_to_cpu((__hdr__)->eh_entries) - 1) + #define EXT_MAX_EXTENT(__hdr__) \ +- (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1) ++ (EXT_FIRST_EXTENT((__hdr__)) + \ ++ ext2fs_le16_to_cpu((__hdr__)->eh_max) - 1) + #define EXT_MAX_INDEX(__hdr__) \ +- (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1) ++ (EXT_FIRST_INDEX((__hdr__)) + \ ++ ext2fs_le16_to_cpu((__hdr__)->eh_max) - 1) + + #endif /* _LINUX_EXT3_EXTENTS */ diff --git a/SOURCES/e2fsprogs-1.42.9-resize2fs-fs-with-errors.patch b/SOURCES/e2fsprogs-1.42.9-resize2fs-fs-with-errors.patch new file mode 100644 index 0000000..b7e5fc7 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-resize2fs-fs-with-errors.patch @@ -0,0 +1,80 @@ +commit 7d7a8fe4ea4d9162977a1a6b32c4737d9ca9dd1f +Author: Eric Sandeen +Date: Mon Jun 9 09:52:19 2014 -0400 + + resize2fs: don't attempt to calculate minimum size on fs with errors + + My old patch: + + resize2fs: don't print minimum size if fs is not clean + + almost did this, but it still calculated the size; it just didn't print + it. Which is a bit silly. + + Jes had a pretty badly corrupted image which made the minimum size + calculation go off into the weeds. It was corrupted, and also marked + as having an error. + + We'll eventually bail out for an unmounted filesystem if it's marked + as being in an error state anyway; just move that test & bail-out + to a much earlier point, and remove the now-duplicate one under the + print_min_size block. + + This will catch & block all resize operations on an offline filesystem + with errors, in one central place. + + Reported-by: Jes Sorensen + Signed-off-by: Eric Sandeen + Signed-off-by: Theodore Ts'o + +diff --git a/resize/main.c b/resize/main.c +index 2b7abff..e65c8e4 100644 +--- a/resize/main.c ++++ b/resize/main.c +@@ -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"), diff --git a/SPECS/e2fsprogs.spec b/SPECS/e2fsprogs.spec index 7defa6a..acce0e1 100644 --- a/SPECS/e2fsprogs.spec +++ b/SPECS/e2fsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing ext2, ext3, and ext4 filesystems Name: e2fsprogs Version: 1.42.9 -Release: 4%{?dist} +Release: 7%{?dist} # License tags based on COPYING file distinctions for various components License: GPLv2 @@ -18,6 +18,14 @@ Patch5: e2fsprogs-1.42.9-enable-lazy_itable_init-on-newer-kernel-by-default.patc Patch6: e2fsprogs-1.42.9-enable-64bit-feature-by-default.patch Patch7: e2fsprogs-1.42.9-disable-resize_inode-feature-if-64bit-feature-is-enabled.patch Patch8: e2fsprogs-1.42.9-no-ppc-altivec.patch +Patch9: e2fsprogs-1.42.9-resize2fs-fs-with-errors.patch +Patch10: e2fsprogs-1.42.9-chattr-manpage-j-update.patch +Patch11: e2fsprogs-1.42.9-chattr-manpage-reorder.patch +Patch12: e2fsprogs-1.42.9-chattr-manpage-update.patch +Patch13: e2fsprogs-1.42.9-ext4-manpage-add-mountopts.patch +Patch14: e2fsprogs-1.42.9-ext4-manpage-add-attrs.patch +Patch15: e2fsprogs-1.42.9-fix-endian-handling-of-ext3_extent_header.patch +Patch16: e2fsprogs-1.42.9-dont-require-fsck-for-resize-p.patch Url: http://e2fsprogs.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -173,6 +181,16 @@ It was originally inspired by the Multics SubSystem library. # Disable some instructions on ppc build of libext2fs; see bug #1074604 # and e2fsprogs-1.42.9-no-ppc-altivec.patch %patch8 -p1 -b .noaltivec +# Don't calc minimum resize2fs size on fs with errors +%patch9 -p1 +# Various updates to attr-related manpages +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 %build %configure --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ @@ -210,15 +228,6 @@ install -p -m 644 %{SOURCE2} %{buildroot}/etc/e2fsck.conf %find_lang %{name} %check -# XXX ERS Hack for now; this bug has existed for a while, -# i.e. it is not a regression in this release, but there -# is no fix yet, and we need to get this package building. -# See Bug 987133 - resize2fs tests failing on ppc, s390 -# ERS 2 Jan 2014 - re-enable for now and see how this goes -#rm -rf tests/r_1024_small_bg* -#rm -rf tests/r_64bit_big_expand* -#rm -rf tests/r_bigalloc_big_expand* -#rm -rf tests/r_ext4_big_expand* make check %clean @@ -365,6 +374,16 @@ exit 0 %{_libdir}/pkgconfig/ss.pc %changelog +* Wed Jan 21 2015 Eric Sandeen 1.42.9-7 +- Don't require e2fsck for resize2fs -P (#1183492) + +* Fri Oct 24 2014 Eric Sandeen 1.42.9-6 +- Fix endian bug in extent code (#1081836) + +* Fri Sep 19 2014 Eric Sandeen 1.42.9-5 +- Various manpage updates for chattr and mount (#1053885) +- Fix resize2fs -P hang on corrupted filesystems (#1104612) + * Tue Mar 11 2014 Lukas Czerner - 1.42.9-4 - Fix posisble use after free in some error paths (#997982) - Enable lazy_itable_init even if ext4 module is not loaded (#1071909)