Date: Wed, 20 Nov 2013 11:05:07 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r258382 - vendor/illumos/dist/lib/libzpool/common Message-ID: <201311201105.rAKB57Zb060207@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Nov 20 11:05:07 2013 New Revision: 258382 URL: http://svnweb.freebsd.org/changeset/base/258382 Log: 4161 deadlock between zfs_read() and zfs_putpage() illumos/illumos-gate@b3d32f0ceb59362ba287dcfd6de471e98bfc7fa9 Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Wed Nov 20 11:04:14 2013 (r258381) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Wed Nov 20 11:05:07 2013 (r258382) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include <assert.h> @@ -221,10 +222,10 @@ rw_enter(krwlock_t *rwlp, krw_t rw) ASSERT(rwlp->rw_owner != (void *)-1UL); ASSERT(rwlp->rw_owner != curthread); - if (rw == RW_READER) - VERIFY(rw_rdlock(&rwlp->rw_lock) == 0); - else + if (rw == RW_WRITER) VERIFY(rw_wrlock(&rwlp->rw_lock) == 0); + else + VERIFY(rw_rdlock(&rwlp->rw_lock) == 0); rwlp->rw_owner = curthread; } @@ -247,10 +248,10 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw) ASSERT(rwlp->initialized == B_TRUE); ASSERT(rwlp->rw_owner != (void *)-1UL); - if (rw == RW_READER) - rv = rw_tryrdlock(&rwlp->rw_lock); - else + if (rw == RW_WRITER) rv = rw_trywrlock(&rwlp->rw_lock); + else + rv = rw_tryrdlock(&rwlp->rw_lock); if (rv == 0) { rwlp->rw_owner = curthread;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311201105.rAKB57Zb060207>