4 Commits
Author SHA1 Message Date
Ernesto A. Fernández 41af006115 0.3.7
This is a small release that fixes the dkms build, recently broken by
the implementation of version reporting. From now on I will run a dkms
build before each new tag.

The release also lifts the ban on filesystems with half-written backup
superblocks, a problem that some users appear to have encountered
already.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2024-01-18 20:07:43 -03:00
Ernesto A. Fernández cba2045422 Report dkms version when git is not available
Some users might build the driver from the tarball that github produces
on release, so the reported git commit would be an empty string. Instead
extract the version from the dkms file and use that, but add a question
mark so that I know that it might not be accurate.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2024-01-18 19:35:20 -03:00
Ernesto A. Fernández 5e133a2ca5 Fix version header generation for dkms
The dkms build fails for the latest release:

  https://github.com/linux-apfs/linux-apfs-rw/pull/60

The problem is that dkms does not call my Makefile at all, so the
version header is never generated. Dkms does have a PRE_BUILD hook
though, so use that to call a script that takes care of this.

From now on, I must always remember to run a dkms build before a new
release.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2024-01-17 22:36:05 -03:00
Ernesto A. Fernández 9ae07db606 Don't refuse to mount a bad backup superblock
The backup superblock is only needed to locate the actual superblock, so
it doesn't matter if it's corrupted beyond the first sector, which the
disk is supposed to write atomically. If a crash happened at the right
moment during unmount, any implementation might end up with a
half-written superblock where the checksum doesn't add up, but that's
perfectly fine.

If this is encountered during mount, just report it and proceed. This is
not a theoretical concern, someone appears to have run into the problem
already:

  https://techsparx.com/linux/ubuntu/mount-apfs.html

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2024-01-08 21:22:08 -03:00
4 changed files with 18 additions and 8 deletions

No files matched your search

+1 -2
View File
@@ -6,7 +6,6 @@
KERNELRELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)
GIT_COMMIT = $(shell git describe HEAD | tail -c 9)
obj-m = apfs.o
apfs-y := btree.o compress.o dir.o extents.o file.o inode.o key.o libzbitmap.o \
@@ -15,7 +14,7 @@ apfs-y := btree.o compress.o dir.o extents.o file.o inode.o key.o libzbitmap.o \
spaceman.o super.o symlink.o transaction.o unicode.o xattr.o xfield.o
default:
@printf '#define GIT_COMMIT\t"%s"\n' $(GIT_COMMIT) > version.h
./genver.sh
make -C $(KERNEL_DIR) M=$(PWD)
install:
make -C $(KERNEL_DIR) M=$(PWD) modules_install
+2 -1
View File
@@ -1,7 +1,8 @@
PACKAGE_NAME="linux-apfs-rw"
PACKAGE_VERSION="0.3.6"
PACKAGE_VERSION="0.3.7"
BUILT_MODULE_NAME[0]="apfs"
DEST_MODULE_LOCATION[0]="/extra"
AUTOINSTALL="yes"
PRE_BUILD="genver.sh"
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Script to generate the module version header
#
if command -v git >/dev/null 2>&1 && [ -d .git ]; then
GIT_COMMIT=$(git describe HEAD | tail -c 9)
else
GIT_COMMIT="$(grep PACKAGE_VERSION dkms.conf | cut -d '"' -f2)?"
fi
printf '#define GIT_COMMIT\t"%s"\n' "$GIT_COMMIT" > version.h
+2 -5
View File
@@ -113,11 +113,8 @@ static struct buffer_head *apfs_read_super_copy(struct super_block *sb)
apfs_err(sb, "not an apfs filesystem");
goto fail;
}
if (!apfs_obj_verify_csum(sb, bh)) {
apfs_err(sb, "inconsistent container superblock");
err = -EFSBADCRC;
goto fail;
}
if (!apfs_obj_verify_csum(sb, bh))
apfs_notice(sb, "backup superblock seems corrupted");
return bh;
fail: