Post by Josef 'Jeff' Sipek via illumos-developerBug: https://www.illumos.org/issues/5253
Webrev: http://31bits.net/illumos/cr/5253-kmem_alloc-kmem_zalloc-wont-fail-with-KM_SLEEP/
Patch: http://repo.or.cz/w/illumos-gate/jeffpc.git/patch/d8eb8859bd8b557647b1524e8c7ab1d8081842f7
Thanks,
Jeff.
From d8eb8859bd8b557647b1524e8c7ab1d8081842f7 Mon Sep 17 00:00:00 2001
Date: Thu, 23 Oct 2014 09:45:27 -0400
Subject: [PATCH] 5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP 5254
getrbuf won't fail with KM_SLEEP
---
usr/src/uts/common/avs/ns/rdc/rdc_bitmap.c | 4 -
Are you sure krdc->bitmap_size is non-zero?
I suggest to add ASSERT(rdc_max_sets != 0) right before the first kmem_zalloc()
and remove empty line at 336.
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/avs/ns/solaris/nsc_raw.c | 7 -
Are you sure maxdevs is non-zero?
ok
Are you sure the size is non-zero?
I suggest to add ASSERT(dca->dca_buf1 != NULL) and ASSERT(dca->dca_buf2 !=
NULL).
ok
ok
ok
Are you sure the softs->total_slots is non-zero?
Are you sure you are allocating more than zero bytes here?
The beep_queue_size looks like a some sort of tunable. You should make sure
somehow it is non-zero.
As an act of defensive programming, I suggest to add ASSERT(bp != NULL) right
after the getrbuf() call.
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c | 4 +-
I suggest to add ASSERT(sl->sl_zfs_meta != NULL) right after the kmem_zalloc()
call.
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/io/comstar/port/pppt/pppt.c | 2 -
Are you sure iocd.pppt_buf_size is non-zero?
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/fibre-channel/fca/qlc/ql_init.c | 13 --
I suggest to add ASSERT(list_size != 0) right before the kmem_zalloc() call.
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/fibre-channel/fca/qlc/ql_ioctl.c | 46 +------
line 931: Are you sure ha->nvram_cache->size is always non-zero?
lines 1150 and 1289: I suggest to add ASSERT(vpd != NULL) after the
kmem_zalloc() call.
line 1557: Are you sure the ha->xioctl->fdesc.block_size is always non-zero?
line 2012 and 2191: Are you sure the dop->length is always non-zero?
line 2065: Are you sure the ha->risc_dump_size is always non-zero?
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/fibre-channel/fca/qlc/ql_mbx.c | 13 +-
ok
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/fibre-channel/fca/qlc/ql_nx.c | 4 -
Are you sure n is aways non-zero?
Post by Josef 'Jeff' Sipek via illumos-developer.../common/io/fibre-channel/fca/qlc/ql_xioctl.c | 140 +-------------------
line 3338: Are you sure plbreq.TransferCount is always non-zero?
line 3630: I suggest to add ASSERT(tmp_buf != NULL) after the kmem_zalloc()
call.
line 6959: I suggest to add ASSERT(bp != NULL) after the kmem_zalloc() call.
lines 7634 and 7717: I suggest to add ASSERT(payload != NULL) after the
kmem_zalloc() call.
line 7833: Are you sure the pci_size is always non-zero?
line 8709: I suggest to add ASSERT(tmp_buf != NULL) after the kmem_zalloc()
call.
line 8951: I suggest to add ASSERT(size != 0) before the kmem_zalloc() call.
line 9028: I suggest to add ASSERT(fcf_list.BufSize != 0) before the
kmem_zalloc() call.
Post by Josef 'Jeff' Sipek via illumos-developer.../common/io/fibre-channel/fca/qlge/qlge_flash.c | 6 -
Are you sure qlge->fdesc.block_size is always non-zero?
ok
ok
line 571: Are you sure count is always non-zero?
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/net80211/net80211_crypto_ccmp.c | 2 -
ok
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/net80211/net80211_crypto_tkip.c | 2 -
ok
Are you sure the n is always non-zero?
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/io/pciex/hotplug/pcie_hp.c | 3 +-
Maybe ASSERT(packed != NULL) should be added, but not needed.
Are you sure sr->sr_size is always non-zero?
Post by Josef 'Jeff' Sipek via illumos-developer.../common/io/scsi/adapters/mpt_sas/mptsas_impl.c | 3 -
I suggest to add ASSERT(ioc_cmd != NULL) before the kmem_zalloc() call.
Post by Josef 'Jeff' Sipek via illumos-developer.../uts/common/io/scsi/adapters/pmcs/pmcs_attach.c | 5 -
ok
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/io/scsi/targets/ses_safte.c | 8 --
line 112: I suggest to add ASSERT(sdata != NULL) right after the kmem_alloc()
call.
line 178: I suggest to add ASSERT(ssc->ses_private != NULL) right after the
kmem_zalloc() call.
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/io/usb/hcd/uhci/uhciutil.c | 10 +-
Are you sure info->num_pools is always non-zero?
Note: No need for extra parens in the kmem_zalloc() call.
ok
lines 2500, 2563, 2586, 2611, 2653, 2682, and 2720: I suggest to add ASSERT(buf
!= NULL) right after the kmem_alloc() call.
I suggest to add ASSERT(dev->d_intrh != NULL) right after the kmem_zalloc()
call.
line 5540: I suggest to add ASSERT(pathname != NULL) right after the
kmem_alloc() call.
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/common/rpc/sec_gss/svc_rpcsec_gss.c | 3 -
ok
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/i86pc/io/gfx_private/gfxp_devmap.c | 5 -
ok
Post by Josef 'Jeff' Sipek via illumos-developerusr/src/uts/i86pc/io/gfx_private/gfxp_pci.c | 10 +-
ok
line 743: I suggest to add ASSERT(secbuf != NULL) right after the kmem_zalloc()
call.
lines 745 and 1689: As an act of defensive programming, I suggest to add
ASSERT(bp != NULL) right after the getrbuf() call.
Are you sure np is always non-zero?
line 785: Are you sure dev->num_heci_me_clients is always non-zero?
Note: Please add space before the asterisk at line 785.
ok
Are you sure the *fcode_size is always non-zero?
ok
--
+-------------------------------------------+
| Marcel Telka e-mail: ***@telka.sk |
| homepage: http://telka.sk/ |
| jabber: ***@jabber.sk |
+-------------------------------------------+
-------------------------------------------
illumos-developer
Archives: https://www.listbox.com/member/archive/182179/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182179/21175072-86d49504
Modify Your Subscription: https://www.listbox.com/member/?member_id=21175072&id_secret=21175072-abdf7b7e
Powered by Listbox: http://www.listbox.com