logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: f4d5cbc3b161190d0e27d07c22f2a13f9e12a4c0
parent eee3ed420e5099bb63681be31496cf1d3b23d5f4
Author: Michael Forney <mforney@mforney.org>
Date:   Wed,  4 Aug 2021 18:40:35 -0700

e2fsprogs: Update to 1.46.3

Diffstat:

Mpkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch92+++++--------------------------------------------------------------------------
Dpkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch40----------------------------------------
Rpkg/e2fsprogs/patch/0004-libsupport-remove-unused-sort_r-definition.patch -> pkg/e2fsprogs/patch/0002-libsupport-remove-unused-sort_r-definition.patch0
Dpkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch40----------------------------------------
4 files changed, 5 insertions(+), 167 deletions(-)

diff --git a/pkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch b/pkg/e2fsprogs/patch/0001-libext2fs-avoid-pointer-arithmetic-on-void.patch @@ -1,4 +1,4 @@ -From c27416b8e150162d8a629dfb6c02c04081531a8b Mon Sep 17 00:00:00 2001 +From e659aeb8ee69392cba017fc306cdea20c8c97b70 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Tue, 2 Mar 2021 14:24:01 -0800 Subject: [PATCH] libext2fs: avoid pointer arithmetic on `void *` @@ -8,13 +8,11 @@ type. Signed-off-by: Michael Forney <mforney@mforney.org> --- - e2fsck/recovery.c | 2 +- - lib/ext2fs/link.c | 20 +++++++++++--------- - lib/ext2fs/unix_io.c | 2 +- - 3 files changed, 13 insertions(+), 11 deletions(-) + e2fsck/recovery.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c -index dc0694fc..889cd0e6 100644 +index 25744f08..3c5a37e9 100644 --- a/e2fsck/recovery.c +++ b/e2fsck/recovery.c @@ -179,7 +179,7 @@ static int jbd2_descriptor_block_csum_verify(journal_t *j, void *buf) @@ -26,86 +24,6 @@ index dc0694fc..889cd0e6 100644 sizeof(struct jbd2_journal_block_tail)); provided = tail->t_checksum; tail->t_checksum = 0; -diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c -index a2c34ac5..80b16ac5 100644 ---- a/lib/ext2fs/link.c -+++ b/lib/ext2fs/link.c -@@ -110,7 +110,8 @@ static errcode_t dx_lookup(ext2_filsys fs, ext2_ino_t dir, - info->frames[0].buf); - if (errcode) - goto out_err; -- root = info->frames[0].buf + EXT2_DX_ROOT_OFF; -+ root = (struct ext2_dx_root_info *) -+ ((char *) info->frames[0].buf + EXT2_DX_ROOT_OFF); - hash_alg = root->hash_version; - if (hash_alg != EXT2_HASH_TEA && hash_alg != EXT2_HASH_HALF_MD4 && - hash_alg != EXT2_HASH_LEGACY) { -@@ -329,19 +330,19 @@ static errcode_t dx_move_dirents(ext2_filsys fs, struct dx_hash_map *map, - csum_size = sizeof(struct ext2_dir_entry_tail); - - for (i = 0; i < count; i++) { -- de = from + map[i].off; -+ de = (struct ext2_dir_entry *) ((char *) from + map[i].off); - rec_len = EXT2_DIR_REC_LEN(ext2fs_dirent_name_len(de)); - memcpy(to, de, rec_len); -- retval = ext2fs_set_rec_len(fs, rec_len, to); -+ retval = ext2fs_set_rec_len(fs, rec_len, (struct ext2_dir_entry *) to); - if (retval) - return retval; -- to += rec_len; -+ to = (char *)to + rec_len; - } - /* - * Update rec_len of the last dir entry to stretch to the end of block - */ -- to -= rec_len; -- rec_len = fs->blocksize - (to - base) - csum_size; -+ to = (char *)to - rec_len; -+ rec_len = fs->blocksize - ((char *) to - (char *) base) - csum_size; - retval = ext2fs_set_rec_len(fs, rec_len, to); - if (retval) - return retval; -@@ -396,7 +397,7 @@ static errcode_t dx_split_leaf(ext2_filsys fs, ext2_ino_t dir, - return retval; - } - for (offset = 0; offset < fs->blocksize; offset += rec_len) { -- de = buf + offset; -+ de = (struct ext2_dir_entry *) ((char *) buf + offset); - retval = ext2fs_get_rec_len(fs, de, &rec_len); - if (retval) - goto out; -@@ -501,7 +502,7 @@ static errcode_t dx_grow_tree(ext2_filsys fs, ext2_ino_t dir, - retval = ext2fs_set_rec_len(fs, fs->blocksize, de); - if (retval) - return retval; -- head = buf + 8; -+ head = (struct ext2_dx_countlimit *) ((char *) buf + 8); - count = ext2fs_le16_to_cpu(info->frames[i+1].head->count); - /* Growing tree depth? */ - if (i < 0) { -@@ -517,7 +518,8 @@ static errcode_t dx_grow_tree(ext2_filsys fs, ext2_ino_t dir, - /* Now update tree root */ - info->frames[0].head->count = ext2fs_cpu_to_le16(1); - info->frames[0].entries[0].block = ext2fs_cpu_to_le32(lblk); -- root = info->frames[0].buf + EXT2_DX_ROOT_OFF; -+ root = (struct ext2_dx_root_info *) -+ ((char *) info->frames[0].buf + EXT2_DX_ROOT_OFF); - root->indirect_levels++; - } else { - /* Splitting internal node in two */ -diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c -index 64eee342..6764a947 100644 ---- a/lib/ext2fs/unix_io.c -+++ b/lib/ext2fs/unix_io.c -@@ -315,7 +315,7 @@ bounce_read: - if (actual > align_size) - actual = align_size; - actual -= offset; -- memcpy(buf, data->bounce + offset, actual); -+ memcpy(buf, (char *) data->bounce + offset, actual); - - really_read += actual; - size -= actual; -- -2.30.0 +2.32.0 diff --git a/pkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch b/pkg/e2fsprogs/patch/0002-libext2fs-use-offsetof-from-stddef.h.patch @@ -1,40 +0,0 @@ -From 54cdf16b2e2f662635accdd2f1987068686ee553 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Tue, 2 Mar 2021 14:37:20 -0800 -Subject: [PATCH] libext2fs: use offsetof() from stddef.h - -offsetof is a standard C feature available from stddef.h, going -back all the way to ANSI C. - -Signed-off-by: Michael Forney <mforney@mforney.org> ---- - lib/ext2fs/compiler.h | 13 +------------ - 1 file changed, 1 insertion(+), 12 deletions(-) - -diff --git a/lib/ext2fs/compiler.h b/lib/ext2fs/compiler.h -index 9aa9b4ec..49fe025e 100644 ---- a/lib/ext2fs/compiler.h -+++ b/lib/ext2fs/compiler.h -@@ -1,18 +1,7 @@ - #ifndef _EXT2FS_COMPILER_H - #define _EXT2FS_COMPILER_H - --#ifndef __has_builtin --#define __has_builtin(x) 0 --#endif -- --#undef offsetof --#if __has_builtin(__builtin_offsetof) --#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) --#elif defined(__compiler_offsetof) --#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) --#else --#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) --#endif -+#include <stddef.h> - - #define container_of(ptr, type, member) ({ \ - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ --- -2.30.0 - diff --git a/pkg/e2fsprogs/patch/0004-libsupport-remove-unused-sort_r-definition.patch b/pkg/e2fsprogs/patch/0002-libsupport-remove-unused-sort_r-definition.patch diff --git a/pkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch b/pkg/e2fsprogs/patch/0003-libext2fs-use-statement-expression-for-container_of-.patch @@ -1,40 +0,0 @@ -From ced6ce86e63fcbc7612253a60b6c87dfb173bd91 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Tue, 2 Mar 2021 14:42:53 -0800 -Subject: [PATCH] libext2fs: use statement-expression for container_of only on - GNU-compatible compilers - -Functionally, the statement-expression is not necessary here; it -just gives a bit of type-safety to make sure the pointer really -does have a compatible type with the specified member of the struct. - -When statement expressions are not available, we can just use a -portable fallback macro that skips this member type check. - -Signed-off-by: Michael Forney <mforney@mforney.org> ---- - lib/ext2fs/compiler.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/lib/ext2fs/compiler.h b/lib/ext2fs/compiler.h -index 49fe025e..42faa61c 100644 ---- a/lib/ext2fs/compiler.h -+++ b/lib/ext2fs/compiler.h -@@ -3,9 +3,14 @@ - - #include <stddef.h> - -+#ifdef __GNUC__ - #define container_of(ptr, type, member) ({ \ - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) -+#else -+#define container_of(ptr, type, member) \ -+ ((type *)((char *)(ptr) - offsetof(type, member))) -+#endif - - - #endif /* _EXT2FS_COMPILER_H */ --- -2.30.0 -