|
|
edefaa |
From acb5300bfc37f8b8c217758e83a31b7ecca84f4a Mon Sep 17 00:00:00 2001
|
|
|
edefaa |
From: "Brian C. Lane" <bcl@redhat.com>
|
|
|
edefaa |
Date: Thu, 10 Jun 2021 15:45:57 -0700
|
|
|
edefaa |
Subject: [PATCH 08/13] fs: Fix copy-paste error in HFS journal code
|
|
|
edefaa |
|
|
|
edefaa |
---
|
|
|
edefaa |
libparted/fs/r/hfs/journal.c | 8 +++++---
|
|
|
edefaa |
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
edefaa |
|
|
|
edefaa |
diff --git a/libparted/fs/r/hfs/journal.c b/libparted/fs/r/hfs/journal.c
|
|
|
edefaa |
index 862d3d3..c7cd009 100644
|
|
|
edefaa |
--- a/libparted/fs/r/hfs/journal.c
|
|
|
edefaa |
+++ b/libparted/fs/r/hfs/journal.c
|
|
|
edefaa |
@@ -337,12 +337,14 @@ hfsj_replay_journal(PedFileSystem* fs)
|
|
|
edefaa |
}
|
|
|
edefaa |
jh->checksum = HFS_CPU_TO_32(cksum, is_le);
|
|
|
edefaa |
|
|
|
edefaa |
- /* The 2 following test are in the XNU Darwin source code */
|
|
|
edefaa |
- /* so I assume they're needed */
|
|
|
edefaa |
+ /* https://github.com/apple-opensource/hfs/blob/master/core/hfs_journal.c#L1167
|
|
|
edefaa |
+ * indicates that this is:
|
|
|
edefaa |
+ * wrap the start ptr if it points to the very end of the journal
|
|
|
edefaa |
+ */
|
|
|
edefaa |
if (jh->start == jh->size)
|
|
|
edefaa |
jh->start = HFS_CPU_TO_64(PED_SECTOR_SIZE_DEFAULT, is_le);
|
|
|
edefaa |
if (jh->end == jh->size)
|
|
|
edefaa |
- jh->start = HFS_CPU_TO_64(PED_SECTOR_SIZE_DEFAULT, is_le);
|
|
|
edefaa |
+ jh->end = HFS_CPU_TO_64(PED_SECTOR_SIZE_DEFAULT, is_le);
|
|
|
edefaa |
|
|
|
edefaa |
if (jh->start == jh->end)
|
|
|
edefaa |
return 1;
|
|
|
edefaa |
--
|
|
|
edefaa |
2.31.1
|
|
|
edefaa |
|