Project

General

Profile

Actions

Bug #15493

closed

zfs: 'spare_guid' may be used uninitialized

Added by Toomas Soome 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

Build error with gcc 12:

    ../../common/fs/zfs/vdev_label.c: In function 'vdev_label_init':
    ../../common/fs/zfs/vdev_label.c:988:24: error: 'spare_guid' may be used uninitialized [-Werror=maybe-uninitialized]
      988 |             spare_guid != 0ULL) {
          |             ~~~~~~~~~~~^~~~~~~
    ../../common/fs/zfs/vdev_label.c:952:18: note: 'spare_guid' declared here
      952 |         uint64_t spare_guid, l2cache_guid;
          |                  ^~~~~~~~~~
    cc1: all warnings being treated as errors

Just set it 0. I also did check OpenZFS for this fix, apparently they have done one relatively large update but our build environment has not revealed more issues (for example, they also set l2cache_guid = 0 above).

Testing done: have used this patch in my build host and test vm's without issues.

Actions

Also available in: Atom PDF