Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel 6.6 compat: fs: rename i_ctime field to __i_ctime #15257

Closed
satmandu opened this issue Sep 11, 2023 · 5 comments
Closed

Kernel 6.6 compat: fs: rename i_ctime field to __i_ctime #15257

satmandu opened this issue Sep 11, 2023 · 5 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@satmandu
Copy link
Contributor

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 23.10
Kernel Version 6.6-rc1
Architecture x86_64
OpenZFS Version 2.2.0-rc4 (with patches for kernel 6.5)

Describe the problem you're observing

Kernel 6.6 renames i_ctime to __I_ctime in torvalds/linux@13bc244

Describe how to reproduce the problem

Build modules against kernel 6.6-rc1.

Include any warning/errors/backtraces from the system logs

During dkms module build I get this error:

  CC [M]  /var/lib/dkms/zfs/2.2.0rc4/build/module/os/linux/zfs/zfs_file_os.o
/var/lib/dkms/zfs/2.2.0rc4/build/module/os/linux/zfs/zfs_ctldir.c: In function ‘zfsctl_inode_alloc’:
/var/lib/dkms/zfs/2.2.0rc4/build/module/os/linux/zfs/zfs_ctldir.c:525:13: error: ‘struct inode’ has no member named ‘i_ctime’; did you mean ‘i_atime’?
  525 |         ip->i_ctime = now;
      |             ^~~~~~~
      |             i_atime
  CC [M]  /var/lib/dkms/zfs/2.2.0rc4/build/module/os/linux/zfs/zfs_ioctl_os.o
@satmandu satmandu added the Type: Defect Incorrect behavior (e.g. crash, hang) label Sep 11, 2023
@ckane
Copy link
Contributor

ckane commented Sep 11, 2023

Looks like the fix to this will be to use inode_get_ctime(i), and the appropriate setter function, for all of these places we have been accessing i->i_ctime directly:

@ckane
Copy link
Contributor

ckane commented Sep 11, 2023

Shouldn't be too difficult, I should be able to knock this one out next week:

$ grep -re i_ctime module/
module/os/linux/zfs/zfs_znode.c:        ZFS_TIME_DECODE(&ip->i_ctime, ctime);
module/os/linux/zfs/zfs_znode.c:        ZFS_TIME_DECODE(&ZTOI(zp)->i_ctime, ctime);
module/os/linux/zfs/zfs_znode.c:        if (zfs_compare_timespec(&ip->i_ctime, &ip->i_atime) >= 0)
module/os/linux/zfs/zfs_znode.c:                ZFS_TIME_DECODE(&(ZTOI(zp)->i_ctime), ctime);
module/os/linux/zfs/zfs_ctldir.c:       ip->i_ctime = now;
module/os/linux/zfs/zpl_xattr.c:                ip->i_ctime = current_time(ip);
module/os/linux/zfs/zpl_xattr.c:                                        ip->i_ctime = current_time(ip);
module/os/linux/zfs/zpl_xattr.c:                        ip->i_ctime = current_time(ip);
module/os/linux/zfs/zpl_inode.c:        ip->i_ctime = current_time(ip);
module/os/linux/zfs/zfs_vnops_os.c:             ZTOI(zp)->i_ctime = zpl_inode_timestamp_truncate(vap->va_ctime,
module/os/linux/zfs/zfs_vnops_os.c:     ZFS_TIME_ENCODE(&ip->i_ctime, ctime);
module/os/linux/zfs/zfs_vnops_os.c:     ZFS_TIME_ENCODE(&ip->i_ctime, ctime);

darkbasic pushed a commit to darkbasic/zfs that referenced this issue Oct 2, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
darkbasic pushed a commit to darkbasic/zfs that referenced this issue Oct 9, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
darkbasic pushed a commit to darkbasic/zfs that referenced this issue Oct 13, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
darkbasic pushed a commit to darkbasic/zfs that referenced this issue Nov 10, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
stgraber pushed a commit to zabbly/zfs that referenced this issue Nov 10, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
ixhamza pushed a commit to truenas/zfs that referenced this issue Nov 20, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
@tw-atroehrsm
Copy link

hello! will there be a 2.1.14 with compat for 6.6 / 6.7 kernels?
I'm currently hesitating upgrading to 2.2.x because of the big changes made

@ckane
Copy link
Contributor

ckane commented Nov 21, 2023

hello! will there be a 2.1.14 with compat for 6.6 / 6.7 kernels? I'm currently hesitating upgrading to 2.2.x because of the big changes made

@tw-atroehrsm - I don't have anything running the 2.1.x code for ZFS so I don't plan on back-porting the changes myself. If you would like someone else from the community who still maintains the 2.1.x code to look into it, I would recommend making an issue request that references this issue and requests the changes to be back-ported.

lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Dec 12, 2023
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
@regularRandom
Copy link

hello! will there be a 2.1.14 with compat for 6.6 / 6.7 kernels? I'm currently hesitating upgrading to 2.2.x because of the big changes made

@tw-atroehrsm - I don't have anything running the 2.1.x code for ZFS so I don't plan on back-porting the changes myself. If you would like someone else from the community who still maintains the 2.1.x code to look into it, I would recommend making an issue request that references this issue and requests the changes to be back-ported.

I have the same issue with 6.6.7 and 2.1.14. I can't use 2.2.x cos Centos 9 repos don't contain it.

robn pushed a commit to robn/zfs that referenced this issue Feb 7, 2024
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes openzfs#15263
Closes openzfs#15257
(cherry picked from commit fe9d409)
tonyhutter pushed a commit that referenced this issue Feb 8, 2024
In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access
to the i_ctime member of struct inode was removed. The new approach is
to use accessor methods that exclusively handle passing the timestamp
around by value. This change adds new tests for each of these functions
and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In
where the inode_get/set_ctime*() functions exist, these zpl_* calls will
be mapped to the new functions. On older kernels, these macros just wrap
direct-access calls. The code that operated on an address of ip->i_ctime
to call ZFS_TIME_DECODE() now will take a local copy using
zpl_inode_get_ctime(), and then pass the address of the local copy when
performing the ZFS_TIME_DECODE() call, in all cases, rather than
directly accessing the member.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #15263
Closes #15257
(cherry picked from commit fe9d409)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

4 participants