Date: Wed, 18 Aug 2010 07:32:24 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r211442 - projects/ofed/head/sys/ofed/include/linux Message-ID: <201008180732.o7I7WO4g058310@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Wed Aug 18 07:32:24 2010 New Revision: 211442 URL: http://svn.freebsd.org/changeset/base/211442 Log: - Properly initialize the free dr bitmap. - Reset the leaf bitmap when freeing an idr item. - Add a lookup and assert after add to catch any other bugs early. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/include/linux/linux_idr.c Modified: projects/ofed/head/sys/ofed/include/linux/linux_idr.c ============================================================================== --- projects/ofed/head/sys/ofed/include/linux/linux_idr.c Wed Aug 18 07:31:28 2010 (r211441) +++ projects/ofed/head/sys/ofed/include/linux/linux_idr.c Wed Aug 18 07:32:24 2010 (r211442) @@ -146,6 +146,7 @@ idr_remove(struct idr *idr, int id) panic("idr_remove: Item %d not allocated (%p, %p)\n", id, idr, il); il->ary[idx] = NULL; + il->bitmap |= 1 << idx; mtx_unlock(&idr->lock); return; } @@ -226,7 +227,7 @@ idr_pre_get(struct idr *idr, gfp_t gfp_m iln = malloc(sizeof(*il), M_IDR, M_ZERO | gfp_mask); if (iln == NULL) break; - iln->bitmap = IDR_MASK; + bitmap_fill(&iln->bitmap, IDR_SIZE); if (head != NULL) { il->ary[0] = iln; il = iln; @@ -327,6 +328,10 @@ idr_get_new(struct idr *idr, void *ptr, error = 0; out: mtx_unlock(&idr->lock); + if (error == 0 && idr_find(idr, id) != ptr) { + panic("idr_get_new: Failed for idr %p, id %d, ptr %p\n", + idr, id, ptr); + } return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008180732.o7I7WO4g058310>