Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2010 19:33:17 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        John Baldwin <jhb@freebsd.org>, scottl@freebsd.org, sbruno@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Fix mfiutil compile with -DDEBUG
Message-ID:  <AANLkTikiaTONmZbLdWW5Np7h1EwxFBeyjsWTxZd43CUt@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--00504501400cf612690491c15d0f
Content-Type: text/plain; charset=ISO-8859-1

    make -DDEBUG is broken in mfiutil:

$ make -DDEBUG
cc -O2 -pipe -fno-strict-aliasing -pipe -O2 -march=nocona
-fno-builtin-strftime -DDEBUG -Wall -Wcast-align -Woverflow
-Wsign-compare -Wunused -std=gnu99 -fstack-protector -Wsystem-headers
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Wno-uninitialized -Wno-pointer-sign -c
/usr/src/usr.sbin/mfiutil/mfi_config.c
/usr/src/usr.sbin/mfiutil/mfi_config.c: In function 'dump_config':
/usr/src/usr.sbin/mfiutil/mfi_config.c:1027: error: 'union mfi_pd_ref'
has no member named 'device_id'
/usr/src/usr.sbin/mfiutil/mfi_config.c:1083: error: 'union mfi_pd_ref'
has no member named 'device_id'
*** Error code 1

Stop in /usr/src/usr.sbin/mfiutil.
$

    device_id is a field in the v field in the mfi_pd_ref union
(/sys/dev/mfi/mfireg.h):

union mfi_pd_ref {
        struct {
                uint16_t        device_id;
                uint16_t        seq_num;
        } v;
        uint32_t        ref;
} __packed;

    The attached patch fixes the compile (and produces logical
results) with make -DDEBUG:

$ sudo /usr/obj/usr/src/usr.sbin/mfiutil/mfiutil debug
mfi0 Configuration (Debug): 1 arrays, 1 volumes, 0 spares
  array size: 288
  volume size: 256
  spare size: 40
    array 0 of 4 drives:
      size = 1951170560
        drive 4 ONLINE
          raw size: 1953525168
          non-coerced size: 1952476592
          coerced size: 1951170560
        drive 5 ONLINE
          raw size: 1953525168
          non-coerced size: 1952476592
          coerced size: 1951170560
        drive 6 ONLINE
          raw size: 1953525168
          non-coerced size: 1952476592
          coerced size: 1951170560
        drive 7 ONLINE
          raw size: 1953525168
          non-coerced size: 1952476592
          coerced size: 1951170560
    volume mfid0 RAID-6 OPTIMAL
      primary raid level: 6
      raid level qualifier: 3
      secondary raid level: 0
      stripe size: 7
      num drives: 4
      init state: 0
      consistent: 1
      no bgi: 0
      spans:
        array 0 @ 0 : 1951170560

Thanks!
-Garrett

--00504501400cf612690491c15d0f
Content-Type: application/octet-stream; name="fix-mfiutil-debug.diff"
Content-Disposition: attachment; filename="fix-mfiutil-debug.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_geupz4eb0

SW5kZXg6IHVzci5zYmluL21maXV0aWwvbWZpX2NvbmZpZy5jCj09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHVzci5z
YmluL21maXV0aWwvbWZpX2NvbmZpZy5jCShyZXZpc2lvbiAyMTMzNzcpCisrKyB1c3Iuc2Jpbi9t
Zml1dGlsL21maV9jb25maWcuYwkod29ya2luZyBjb3B5KQpAQCAtMTAyNCw3ICsxMDI0LDcgQEAK
IAkJICAgIGFyLT5udW1fZHJpdmVzKTsKIAkJcHJpbnRmKCIgICAgICBzaXplID0gJWp1XG4iLCAo
dWludG1heF90KWFyLT5zaXplKTsKIAkJZm9yIChqID0gMDsgaiA8IGFyLT5udW1fZHJpdmVzOyBq
KyspIHsKLQkJCWRldmljZV9pZCA9IGFyLT5wZFtqXS5yZWYuZGV2aWNlX2lkOworCQkJZGV2aWNl
X2lkID0gYXItPnBkW2pdLnJlZi52LmRldmljZV9pZDsKIAkJCWlmIChkZXZpY2VfaWQgPT0gMHhm
ZmZmKQogCQkJCXByaW50ZigiICAgICAgICBkcml2ZSBNSVNTSU5HXG4iKTsKIAkJCWVsc2UgewpA
QCAtMTA4MCw3ICsxMDgwLDcgQEAKIAkJc3AgPSAoc3RydWN0IG1maV9zcGFyZSAqKXA7CiAJCXBy
aW50ZigiICAgICVzIHNwYXJlICV1ICIsCiAJCSAgICBzcC0+c3BhcmVfdHlwZSAmIE1GSV9TUEFS
RV9ERURJQ0FURUQgPyAiZGVkaWNhdGVkIiA6Ci0JCSAgICAiZ2xvYmFsIiwgc3AtPnJlZi5kZXZp
Y2VfaWQpOworCQkgICAgImdsb2JhbCIsIHNwLT5yZWYudi5kZXZpY2VfaWQpOwogCQlwcmludGYo
IiVzIiwgbWZpX3Bkc3RhdGUoTUZJX1BEX1NUQVRFX0hPVF9TUEFSRSkpOwogCQlwcmludGYoIiBi
YWNrczpcbiIpOwogCQlmb3IgKGogPSAwOyBqIDwgc3AtPmFycmF5X2NvdW50OyBqKyspCg==
--00504501400cf612690491c15d0f--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikiaTONmZbLdWW5Np7h1EwxFBeyjsWTxZd43CUt>