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

Linux 6.6 compat: fix uninitialized timespec for LLVM #15559

Closed
wants to merge 1 commit into from

Conversation

arter97
Copy link

@arter97 arter97 commented Nov 22, 2023

Commit fe9d409 ("Linux 6.6 compat: use inode_get/set_ctime*(...)") adds compatibility with Linux v6.6 but people using the LLVM toolchain for their kernels encounter kabi check failure due to uninitialized ts:

/var/lib/dkms/zfs/2.2.1/build/build/inode_set_ctime_to_ts/inode_set_ctime_to_ts.c:79:30: error: variable 'ts' is uninitialized when used here [-Werror,-Wuninitialized]
   79 |                 inode_set_ctime_to_ts(&ip, ts);
      |                                            ^~
/var/lib/dkms/zfs/2.2.1/build/build/inode_set_ctime_to_ts/inode_set_ctime_to_ts.c:76:3: note: variable 'ts' is declared here
   76 |                 struct timespec64 ts;
      |                 ^

Similar incident was fixed with commit 3e5d41d ("config/kernel-inode-times: initialize timespec").

Follow it and initialize ts.

Fixes: fe9d409 ("Linux 6.6 compat: use inode_get/set_ctime*(...)")

Motivation and Context

Using the latest OpenZFS with Linux v6.6 built with LLVM 17 toolchain breaks autoconf and therefore the kernel module build.

Description

Similar issue was handled before. This commit follows the previous commit's patch and initializes struct timespec64 ts for LLVM compiler.

How Has This Been Tested?

Build-tested with Linux v6.6 using the LLVM 17 toolchain and checked ZFS module loads and behaves correctly.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Commit fe9d409 ("Linux 6.6 compat: use inode_get/set_ctime*(...)")
adds compatibility with Linux v6.6 but people using the LLVM toolchain for
their kernels encounter kabi check failure due to uninitialized `ts`:

```
/var/lib/dkms/zfs/2.2.1/build/build/inode_set_ctime_to_ts/inode_set_ctime_to_ts.c:79:30: error: variable 'ts' is uninitialized when used here [-Werror,-Wuninitialized]
   79 |                 inode_set_ctime_to_ts(&ip, ts);
      |                                            ^~
/var/lib/dkms/zfs/2.2.1/build/build/inode_set_ctime_to_ts/inode_set_ctime_to_ts.c:76:3: note: variable 'ts' is declared here
   76 |                 struct timespec64 ts;
      |                 ^
```

Similar incident was fixed with commit 3e5d41d
("config/kernel-inode-times: initialize timespec").

Follow it and initialize `ts`.

Fixes: fe9d409 ("Linux 6.6 compat: use inode_get/set_ctime*(...)")
Signed-off-by: Juhyung Park <[email protected]>
@arter97
Copy link
Author

arter97 commented Nov 22, 2023

Welp, didn't know #15558 was active.

@kentdobias, @tonyhutter Dunno how nit-picky those configuration code should be, but I believe memset is more inline with existing code.

Feel free to kang my commit message and the memset part if you deem it's cleaner.

@behlendorf
Copy link
Contributor

Thanks for the fix, we've gone ahead and merged #15558 for this.

@behlendorf behlendorf closed this Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants