2 Commits
Author SHA1 Message Date
Ernesto A. Fernández 1db8a6d92a 0.3.18
This release adds support for the upcoming 6.19 kernel version.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2026-01-30 18:44:25 -03:00
Ernesto A. Fernández a3bca211bd Don't access inode state directly in 6.19
The build is broken for the 6.19 release candidate:

  https://github.com/linux-apfs/linux-apfs-rw/issues/109

The problem is that the inode i_state field can no longer be accessed
directly. Switch to the new helpers, using a wrapper to keep the code
consistent for all kernel versions.

Note that I always use the *_raw version of the helpers to avoid a lockdep
check that will not pass. I can't tell for sure if this is a bug.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2025-12-30 20:51:14 -03:00
5 changed files with 33 additions and 5 deletions

No files matched your search

+27
View File
@@ -1216,6 +1216,33 @@ static inline void apfs_assert_query_is_valid(const struct apfs_query *query)
#define page_has_buffers(page) folio_buffers(page_folio(page))
#endif
static inline int apfs_inode_state_read_once(struct inode *inode)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
return inode_state_read_once(inode);
#else
return inode->i_state;
#endif
}
static inline void apfs_inode_state_set_raw(struct inode *inode, int flags)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
inode_state_set_raw(inode, flags);
#else
inode->i_state |= flags;
#endif
}
static inline void apfs_inode_state_clear_raw(struct inode *inode, int flags)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
inode_state_clear_raw(inode, flags);
#else
inode->i_state &= ~flags;
#endif
}
/*
* TODO: the following are modified variants of buffer head functions that will
* work with the shared block device for the container. The correct approach
+3 -2
View File
@@ -1255,9 +1255,10 @@ static void __apfs_undo_unlink(struct dentry *dentry)
{
struct inode *inode = d_inode(dentry);
inode->i_state |= I_LINKABLE; /* Silence warning about nlink 0->1 */
/* Silence warning about nlink 0->1 */
apfs_inode_state_set_raw(inode, I_LINKABLE);
inc_nlink(inode);
inode->i_state &= ~I_LINKABLE;
apfs_inode_state_clear_raw(inode, I_LINKABLE);
apfs_undo_delete_dentry(dentry);
}
+1 -1
View File
@@ -1,5 +1,5 @@
PACKAGE_NAME="linux-apfs-rw"
PACKAGE_VERSION="0.3.17"
PACKAGE_VERSION="0.3.18"
BUILT_MODULE_NAME[0]="apfs"
DEST_MODULE_LOCATION[0]="/extra"
+1 -1
View File
@@ -1037,7 +1037,7 @@ struct inode *apfs_iget(struct super_block *sb, u64 cnid)
inode = apfs_iget_locked(sb, cnid);
if (!inode)
return ERR_PTR(-ENOMEM);
if (!(inode->i_state & I_NEW))
if (!(apfs_inode_state_read_once(inode) & I_NEW))
return inode;
down_read(&nxi->nx_big_sem);
+1 -1
View File
@@ -468,7 +468,7 @@ int apfs_transaction_flush_all_inodes(struct super_block *sb)
curr_err = apfs_update_inode(inode, NULL /* new_name */);
if (curr_err)
err = curr_err;
inode->i_state &= ~I_DIRTY_ALL;
apfs_inode_state_clear_raw(inode, I_DIRTY_ALL);
/*
* The same inode may get dirtied again as soon as we release