Prepare for rebase

This commit is contained in:
Bruno Wolff III 2021-09-13 08:50:22 -05:00
parent dae6dc6e91
commit 8bc59796df
2 changed files with 0 additions and 35 deletions

View File

@ -1,30 +0,0 @@
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index aaa4b002bd87..127df00fb789 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -2190,10 +2190,23 @@ static struct file_info *duplicate(int *dupf, int *block_dup, long long file_siz
/* Yes, the block list matches. We can use this, rather
* than writing an identical block list.
* If both it and us doesn't have a tail-end fragment, then we're
- * finished. Return the duplicate */
+ * finished. Return the duplicate.
+ *
+ * We have to deal with the special case where the
+ * last block is a sparse block. This means the
+ * file will have matched, but, it may be a different
+ * file length (because a tail-end sparse block may be
+ * anything from 1 byte to block_size - 1 in size, but
+ * stored as zero). We can still use the block list in
+ * this case, but, we must return a new entry with the
+ * correct file size */
if(!frag_bytes && !dupl_ptr->fragment->size) {
*dupf = *block_dup = TRUE;
- return dupl_ptr;
+ if(file_size == dupl_ptr->file_size)
+ return dupl_ptr;
+ else
+ return create_non_dup(file_size, bytes, blocks, sparse, dupl_ptr->block_list,
+ dupl_ptr->start, dupl_ptr->fragment, checksum, 0, checksum_flag, FALSE);
}
/* We've got a tail-end fragment, and this file most likely

View File

@ -11,10 +11,6 @@ Source: 4.5.tar.gz
# Man pages still need a lot of changes for 4.5
Source1: mksquashfs.1
Source2: unsquashfs.1
# Mksquashfs: fix duplicate check when last file block is sparse
# git diff 19b161c1cd3e31f7a396ea92dea4390ad43f27b9^ 19b161c1cd3e31f7a396ea92dea4390ad43f27b9 > fix-sparse.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=1985561
Patch0: fix-sparse.patch
BuildRequires: make
BuildRequires: gcc
@ -31,7 +27,6 @@ contains the utilities for manipulating squashfs filesystems.
%prep
%setup -n %{name}-4.5
%patch0 -p1
%build
%set_build_flags