Skip to content

Commit

Permalink
Linux 6.6 compat: fix uninitialized timespec for LLVM
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
arter97 committed Nov 22, 2023
1 parent 55dd24c commit 060d6a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/kernel-inode-times.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
struct timespec64 ts;
memset(&ip, 0, sizeof(ip));
memset(&ts, 0, sizeof(ts));
inode_set_ctime_to_ts(&ip, ts);
])
])
Expand Down

0 comments on commit 060d6a7

Please sign in to comment.