linux-apfs / linux-apfs-rw

APFS module for linux, with experimental write support
GNU General Public License v2.0
510 stars 34 forks source link

Kernel 6.6 #52

Closed terraluna977 closed 10 months ago

terraluna977 commented 11 months ago

Fix for kernel 6.6 build errors. I have only one Mac system where apfs is failing in reading the superblock in kernels 6.3..6.6, so did not test properly the functionality.

eafer commented 11 months ago

Hi, thanks for the report. I'm guessing we are still a few weeks away from 6.6 release, so I'll wait until we are closer to pick up your work and make a new release.

By the way, you say that the driver is failing to read the superblock from your filesystem. That probably means that the filesystem is encrypted or has some other unsupported feature. If you can create an image with that feature and sent it to me I'll try to implement what you need.

terraluna977 commented 11 months ago

Actually I am "confused". The only system I am testing on is a High Sierra old MacbookPro. Looking at the diskutil's info it says it is hfs file system? Yet I can not mount it with hpfs, hfsplus nor apfs. OTOH I have created a fresh USB APFS volume, and I can read/write from it on Linux. The interesting thing I have noticed is that it seems to be mounting it r-o by default. I can force remount,rw but then it will not allow writing from user, just root. It is an unexpected behavior. Did you have a similar issue?

eafer commented 11 months ago

There is an explicit "readwrite" mount option that you need to use if you want to enable write support. This is explained in the readme. The point is to make sure users understand that this is risky.

eafer commented 10 months ago

Hey, I just pushed this to the development branch. I made 3 small changes because I thought a few lines were overly complicated, for instance here:

+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
        parent->i_mtime = parent->i_ctime = current_time(inode);
+#else
+       inode_set_ctime_to_ts(parent, inode_set_ctime_current(inode));
+       parent->i_mtime = inode_set_ctime_current(parent);
+#endif

There was no need to update ctime in the child inode, and you are updating ctime in the parent twice. Not a big deal I think, but feel free to let me know if I broke anything.

Thanks again, it's very helpful to let me know early when a kernel release breaks stuff.

eafer commented 10 months ago

I just made a release with your changes, so I guess I can close this now.