* Thu Jan 29 2009 Eric Sandeen <sandeen@redhat.com> 1.41.4-1

- New upstream release
- Dropped btrfs & resize fixes, upstream now
This commit is contained in:
Eric Sandeen 2009-01-29 22:20:37 +00:00
parent 71a579261f
commit 598edd1766
5 changed files with 8 additions and 409 deletions

View File

@ -1 +1 @@
e2fsprogs-1.41.3.tar.gz
e2fsprogs-1.41.4.tar.gz

View File

@ -1,165 +0,0 @@
Add btrfs detection to libblkid, now that the disk format should be
recognizable in the future.
# misc/blkid /tmp/fsfile
/tmp/fsfile: LABEL="mylabel" UUID="102b07f0-0e79-4b42-8a4e-1dde418bbe6d" TYPE="btrfs"
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Index: e2fsprogs/lib/blkid/probe.c
===================================================================
--- e2fsprogs.orig/lib/blkid/probe.c
+++ e2fsprogs/lib/blkid/probe.c
@@ -1293,6 +1293,22 @@ static int probe_lvm2(struct blkid_probe
return 0;
}
+
+static int probe_btrfs(struct blkid_probe *probe,
+ struct blkid_magic *id,
+ unsigned char *buf)
+{
+ struct btrfs_super_block *bs;
+ const char *label = 0;
+
+ bs = (struct btrfs_super_block *)buf;
+
+ if (strlen(bs->label))
+ label = bs->label;
+ blkid_set_tag(probe->dev, "LABEL", label, sizeof(bs->label));
+ set_uuid(probe->dev, bs->fsid, 0);
+ return 0;
+}
/*
* Various filesystem magics that we can check for. Note that kboff and
* sboff are in kilobytes and bytes respectively. All magics are in
@@ -1386,6 +1402,7 @@ static struct blkid_magic type_array[] =
{ "lvm2pv", 0, 0x018, 8, "LVM2 001", probe_lvm2 },
{ "lvm2pv", 1, 0x018, 8, "LVM2 001", probe_lvm2 },
{ "lvm2pv", 1, 0x218, 8, "LVM2 001", probe_lvm2 },
+ { "btrfs", 64, 0x40, 8, "_BHRfS_M", probe_btrfs },
{ NULL, 0, 0, 0, NULL, NULL }
};
Index: e2fsprogs/lib/blkid/probe.h
===================================================================
--- e2fsprogs.orig/lib/blkid/probe.h
+++ e2fsprogs/lib/blkid/probe.h
@@ -621,6 +621,110 @@ struct lvm2_pv_label_header {
__u8 pv_uuid[LVM2_ID_LEN];
} __attribute__ ((packed));
+
+/*
+ * this is a very generous portion of the super block, giving us
+ * room to translate 14 chunks with 3 stripes each.
+ */
+#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
+#define BTRFS_LABEL_SIZE 256
+#define BTRFS_UUID_SIZE 16
+#define BTRFS_FSID_SIZE 16
+#define BTRFS_CSUM_SIZE 32
+
+struct btrfs_dev_item {
+ /* the internal btrfs device id */
+ __u64 devid;
+
+ /* size of the device */
+ __u64 total_bytes;
+
+ /* bytes used */
+ __u64 bytes_used;
+
+ /* optimal io alignment for this device */
+ __u32 io_align;
+
+ /* optimal io width for this device */
+ __u32 io_width;
+
+ /* minimal io size for this device */
+ __u32 sector_size;
+
+ /* type and info about this device */
+ __u64 type;
+
+ /* expected generation for this device */
+ __u64 generation;
+
+ /*
+ * starting byte of this partition on the device,
+ * to allowr for stripe alignment in the future
+ */
+ __u64 start_offset;
+
+ /* grouping information for allocation decisions */
+ __u32 dev_group;
+
+ /* seek speed 0-100 where 100 is fastest */
+ __u8 seek_speed;
+
+ /* bandwidth 0-100 where 100 is fastest */
+ __u8 bandwidth;
+
+ /* btrfs generated uuid for this device */
+ __u8 uuid[BTRFS_UUID_SIZE];
+
+ /* uuid of FS who owns this device */
+ __u8 fsid[BTRFS_UUID_SIZE];
+} __attribute__ ((__packed__));
+
+/*
+ * the super block basically lists the main trees of the FS
+ * it currently lacks any block count etc etc
+ */
+struct btrfs_super_block {
+ __u8 csum[BTRFS_CSUM_SIZE];
+ /* the first 3 fields must match struct btrfs_header */
+ __u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+ __u64 bytenr; /* this block number */
+ __u64 flags;
+
+ /* allowed to be different from the btrfs_header from here own down */
+ __u64 magic;
+ __u64 generation;
+ __u64 root;
+ __u64 chunk_root;
+ __u64 log_root;
+
+ /* this will help find the new super based on the log root */
+ __u64 log_root_transid;
+ __u64 total_bytes;
+ __u64 bytes_used;
+ __u64 root_dir_objectid;
+ __u64 num_devices;
+ __u32 sectorsize;
+ __u32 nodesize;
+ __u32 leafsize;
+ __u32 stripesize;
+ __u32 sys_chunk_array_size;
+ __u64 chunk_root_generation;
+ __u64 compat_flags;
+ __u64 compat_ro_flags;
+ __u64 incompat_flags;
+ __u16 csum_type;
+ __u8 root_level;
+ __u8 chunk_root_level;
+ __u8 log_root_level;
+ struct btrfs_dev_item dev_item;
+
+ char label[BTRFS_LABEL_SIZE];
+
+ /* future expansion */
+ __u64 reserved[32];
+ __u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
+} __attribute__ ((__packed__));
+
/*
* Byte swap functions
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -1,234 +0,0 @@
commit c58a08e673a10d0e5fa4855ca58ab2cbf48fd029
Author: Theodore Ts'o <tytso@mit.edu>
Date: Mon Jan 19 08:43:36 2009 -0500
resize2fs: Move all required blocks for ext4 filesystems
In the function blocks_to_move(), when checking to see if a block
group's block bitmap is initialized, we need to check the old_fs's
block group descriptors, not the new file system's (already truncated)
group descriptor data structures. Otherwise we will end up
derferencing past the end of the array boundary, and the resulting
garbage value may indicate that the bitmap is uninitialized, and so
all of the blocks in that block group will be skipped, resulting in
some blocks not getting marked as needing relocation.
This showed up in the following test case:
mke2fs -t ext4 -b 1024 test.img 1048576
resize2fs test.img 80000
The journal inode after the resize operation looked like this:
debugfs: stat <8>
Inode: 8 Type: regular Mode: 0600 Flags: 0x80000
...
BLOCKS:
(IND):35385, (0-5836):2356-8192, (5837-21959):8454-24576, (21960-32506):24838-35
384, (32507-32767):434177-434437
TOTAL: 32769
The blocks 434177-434437 were not moved because block group 53 was
wrongly thought to have an unitialized block group.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index abe05f5..e7a08da 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -745,7 +745,7 @@ static errcode_t blocks_to_move(ext2_resize_t rfs)
g = ext2fs_group_of_blk(fs, blk);
if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
- (fs->group_desc[g].bg_flags & EXT2_BG_BLOCK_UNINIT)) {
+ (old_fs->group_desc[g].bg_flags & EXT2_BG_BLOCK_UNINIT)) {
/*
* The block bitmap is uninitialized, so skip
* to the next block group.
commit 9227c5bbbd0861878ae73f7dceb4deb9e9f06a3c
Author: Theodore Ts'o <tytso@mit.edu>
Date: Mon Jan 19 09:02:55 2009 -0500
resize2fs: Release bitmap and itable blocks in flex_bg filesystems
Previously resize2fs assumed that bitmap and inode table blocks were
always located in their respective block group. However, this is no
longer true with flex_bg. So it is necessary to check all of the
block groups which will be truncated to see if they have metadata
blocks that need to be marked as no longer being in use in the new,
shrunk filesystem.
This bug fixes resize2fs -M, which would otherwise fail because
without the released blocks, there would not be enough space in the
filesystem. This bug also avoids (mostly harmless) filesystem
corruptions reported by e2fsck regarding blocks marked in use but not
actually used (these being the bitmap and inode table blocks
associated with the truncated block groups).
Note: in theory it is possible to have block group N utilize bitmap
and inode table blocks in block group N+X with flex_bg. At the moment
neither mke2fs nor e2fsck will create filesystems like this, which is
good, because resize2fs doesn't handle this case correctly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index e7a08da..df4dac7 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -232,6 +232,35 @@ static void fix_uninit_block_bitmaps(ext2_filsys fs)
*/
/*
+ * If the group descriptor's bitmap and inode table blocks are valid,
+ * release them in the specified filesystem data structure
+ */
+static void free_gdp_blocks(ext2_filsys fs, struct ext2_group_desc *gdp)
+{
+ blk_t blk;
+ int j;
+
+ if (gdp->bg_block_bitmap &&
+ (gdp->bg_block_bitmap < fs->super->s_blocks_count))
+ ext2fs_block_alloc_stats(fs, gdp->bg_block_bitmap, -1);
+
+ if (gdp->bg_inode_bitmap &&
+ (gdp->bg_inode_bitmap < fs->super->s_blocks_count))
+ ext2fs_block_alloc_stats(fs, gdp->bg_inode_bitmap, -1);
+
+ if (gdp->bg_inode_table == 0 ||
+ (gdp->bg_inode_table >= fs->super->s_blocks_count))
+ return;
+
+ for (blk = gdp->bg_inode_table, j = 0;
+ j < fs->inode_blocks_per_group; j++, blk++) {
+ if (blk >= fs->super->s_blocks_count)
+ break;
+ ext2fs_block_alloc_stats(fs, blk, -1);
+ }
+}
+
+/*
* This routine is shared by the online and offline resize routines.
* All of the information which is adjusted in memory is done here.
*/
@@ -374,6 +403,14 @@ retry:
* can exit now.
*/
if (old_fs->group_desc_count > fs->group_desc_count) {
+ /*
+ * Check the block groups that we are chopping off
+ * and free any blocks associated with their metadata
+ */
+ for (i = fs->group_desc_count;
+ i < old_fs->group_desc_count; i++) {
+ free_gdp_blocks(fs, &old_fs->group_desc[i]);
+ }
retval = 0;
goto errout;
}
commit d3a8fc5ae68477118e32813230518bf4ccc73bf9
Author: Theodore Ts'o <tytso@mit.edu>
Date: Mon Jan 19 14:22:52 2009 -0500
ext2fs_block_iterate2: Reflect errors from ext2fs_extent_set_bmap to caller
If the callback function tries to change a block, and
ext2fs_extent_set_bmap() fails for some reason (for example, there
isn't enough disk space to split a node and expand the extent tree,
make sure that error is reflected back up to the caller.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index b19c450..51fdd9a 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -434,7 +434,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
(blk64_t) blockcnt,
(blk64_t) new_blk, 0);
if (ctx.errcode)
- break;
+ goto extent_errout;
}
if (ret & BLOCK_ABORT)
break;
commit 07f1a070ff45c8381c3ddf8552c726525104e1ee
Author: Theodore Ts'o <tytso@mit.edu>
Date: Mon Jan 19 19:30:59 2009 -0500
ext2fs_block_iterate2: Preserve the uninit flag in extents
When modifying a block via the block_iterate interface, preserve the
uninit flag in the extent. Resize2fs uses this interface, so we have
to preserve the uninit status when relocating a block.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index 51fdd9a..6ac9379 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -364,6 +364,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
e2_blkcnt_t blockcnt = 0;
blk_t blk, new_blk;
int op = EXT2_EXTENT_ROOT;
+ int uninit;
unsigned int j;
ctx.errcode = ext2fs_extent_open(fs, ino, &handle);
@@ -419,6 +420,9 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
}
continue;
}
+ uninit = 0;
+ if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)
+ uninit = EXT2_EXTENT_SET_BMAP_UNINIT;
for (blockcnt = extent.e_lblk, j = 0;
j < extent.e_len;
blk++, blockcnt++, j++) {
@@ -432,7 +436,8 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
ctx.errcode =
ext2fs_extent_set_bmap(handle,
(blk64_t) blockcnt,
- (blk64_t) new_blk, 0);
+ (blk64_t) new_blk,
+ uninit);
if (ctx.errcode)
goto extent_errout;
}
commit 793a04a0719d5688a0033e4bda3cf267f57ea760
Author: Theodore Ts'o <tytso@mit.edu>
Date: Tue Jan 20 00:46:06 2009 -0500
resize2fs: Reserve some extra space for -P/-M for ext4 filesystems
Some extra blocks may be needed to expand some extent allocation trees
while we are shrinking the filesystem. We don't know exactly how
much, so we use a hueristic.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index df4dac7..b7c42ce 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -1954,5 +1954,13 @@ blk_t calculate_minimum_resize_size(ext2_filsys fs)
blks_needed = (groups-1) * EXT2_BLOCKS_PER_GROUP(fs->super);
blks_needed += overhead;
+ /*
+ * We need to reserve a few extra blocks if extents are
+ * enabled, in case we need to grow the extent tree. The more
+ * we shrink the file system, the more space we need.
+ */
+ if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
+ blks_needed += (fs->super->s_blocks_count - blks_needed)/500;
+
return blks_needed;
}

View File

@ -3,8 +3,8 @@
Summary: Utilities for managing the second and third extended (ext2/ext3) filesystems
Name: e2fsprogs
Version: 1.41.3
Release: 4%{?dist}
Version: 1.41.4
Release: 1%{?dist}
# License based on upstream-modified COPYING file,
# which clearly states "V2" intent.
License: GPLv2
@ -15,8 +15,6 @@ Source2: blkid_types-wrapper.h
Source3: uuidd.init
Patch1: e2fsprogs-1.38-etcblkid.patch
Patch2: e2fsprogs-1.40.4-sb_feature_check_ignore.patch
Patch3: e2fsprogs-1.41.3-blkid-btrfs.patch
Patch4: e2fsprogs-1.41.3-resize2fs-fixes.patch
Url: http://e2fsprogs.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -93,10 +91,6 @@ SMP systems.
# mildly unsafe but 'til I get something better, avoid full fsck
# after an selinux install...
%patch2 -p1 -b .featurecheck
# Only change the journal placement for ext4, for now.
%patch3 -p1 -b .journalmove
# Fix some resize2fs issues
%patch4 -p1 -b .resize2fs
%build
%configure --enable-elf-shlibs --enable-nls --disable-e2initrd-helper --enable-blkid-devmapper --enable-blkid-selinux
@ -295,6 +289,10 @@ fi
%dir %attr(2775, uuidd, uuidd) /var/lib/libuuid
%changelog
* Thu Jan 29 2009 Eric Sandeen <sandeen@redhat.com> 1.41.4-1
- New upstream release
- Dropped btrfs & resize fixes, upstream now
* Tue Jan 20 2009 Eric Sandeen <sandeen@redhat.com> 1.41.3-4
- resize2fs fixes, esp. for ext4

View File

@ -1 +1 @@
b21d26fc46c584021dc9c444933ee1c2 e2fsprogs-1.41.3.tar.gz
59033388df36987d2b9c9bbf7e19bd57 e2fsprogs-1.41.4.tar.gz