From owner-freebsd-geom@FreeBSD.ORG Sun Jan 31 16:56:41 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FE7A106566B for ; Sun, 31 Jan 2010 16:56:41 +0000 (UTC) (envelope-from nonsolosoft@diff.org) Received: from smtpi3.ngi.it (smtpi3.ngi.it [88.149.128.33]) by mx1.freebsd.org (Postfix) with ESMTP id 4081B8FC18 for ; Sun, 31 Jan 2010 16:56:41 +0000 (UTC) Received: from lap.diff.org (81-174-26-135.static.ngi.it [81.174.26.135]) by smtpi3.ngi.it (Postfix) with ESMTP id 392D6319A67 for ; Sun, 31 Jan 2010 17:40:58 +0100 (CET) Message-ID: <4B65B29A.6090904@diff.org> Date: Sun, 31 Jan 2010 17:40:58 +0100 From: Ferruccio Zamuner Organization: NonSoLoSoft User-Agent: Thunderbird 2.0.0.16 (X11/20080917) MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: multipart/mixed; boundary="------------010901080904030004050005" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: how to change provider for next boot? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 16:56:41 -0000 This is a multi-part message in MIME format. --------------010901080904030004050005 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I've a gmirror degraded on ad4s1 and ad4s1 has some error: Jan 31 16:36:06 r1 kernel: ad4: FAILURE - READ_DMA status=51 error=40 LBA=43164095 Jan 31 16:36:06 r1 kernel: GEOM_MIRROR: Request failed (error=5). ad4s1[READ(offset=22099918848, length=131072)] ad6s1 was in mirror with ad4s1, how can I tell to the system to boot from ad6s1next time? Thank you in advance. Bye, \ferz --------------010901080904030004050005-- From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 09:23:58 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD04106566B; Mon, 1 Feb 2010 09:23:58 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8D08FC1A; Mon, 1 Feb 2010 09:23:56 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 4DF5C45E97; Mon, 1 Feb 2010 10:23:51 +0100 (CET) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3A69B45CD9; Mon, 1 Feb 2010 10:23:37 +0100 (CET) Date: Mon, 1 Feb 2010 10:23:34 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20100201092334.GB1743@garage.freebsd.pl> References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <20100130114451.GB1660@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , kib@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 09:23:59 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > Maybe I'll add how I understand what's going on: >=20 > GEOM calls destroy_dev() while holding the topology lock. >=20 > Destroy_dev() wants to destroy device, but can't because there are > threads that still have it open. >=20 > The threads can't close it, because to close it they need the topology > lock. >=20 > The deadlock is quite obvious, IMHO. Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes the problem for me (at least it makes race window so small that I can't reproduce it). Is there anyone who isn't happy with such a change? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLZp2WForvXbEpPzQRAn35AJ90hK1k5qJWXM68Y6u2ZFu7WP3E+gCgmqPv 6sEImmRWQ3kLgUElGxoKA04= =o3JH -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG-- From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 09:37:26 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF67106568B; Mon, 1 Feb 2010 09:37:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0CA8FC14; Mon, 1 Feb 2010 09:37:24 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=997wlf2A6M0A:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=u5rT9GMeTmaUgEkNOPQA:9 a=24a_TDEfwaxw72SPfbkA:7 a=f3IbZGw5FHbRJNiLlJho4bEFI7kA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 628255019; Mon, 01 Feb 2010 10:37:23 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Mon, 1 Feb 2010 10:35:57 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <4B636812.8060403@FreeBSD.org> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> In-Reply-To: <20100201092334.GB1743@garage.freebsd.pl> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002011035.57862.hselasky@c2i.net> Cc: kib@freebsd.org, Alexander Motin , FreeBSD-Current , Pawel Jakub Dawidek , freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 09:37:26 -0000 On Monday 01 February 2010 10:23:34 Pawel Jakub Dawidek wrote: > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > > Maybe I'll add how I understand what's going on: > > > > GEOM calls destroy_dev() while holding the topology lock. > > > > Destroy_dev() wants to destroy device, but can't because there are > > threads that still have it open. > > > > The threads can't close it, because to close it they need the topology > > lock. > > > > The deadlock is quite obvious, IMHO. > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > the problem for me (at least it makes race window so small that I can't > reproduce it). Is there anyone who isn't happy with such a change? > Are you sure there are no races or leftover resources that can be accessed by the callbacks of the device being destroyed? --HPS From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 10:11:23 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB7F106568F; Mon, 1 Feb 2010 10:11:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 105978FC26; Mon, 1 Feb 2010 10:11:20 +0000 (UTC) Received: by fxm27 with SMTP id 27so6636fxm.3 for ; Mon, 01 Feb 2010 02:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=4C+2dtjr7H34TXYZfwwNTmVG0F2U2MYsuZpisFty3SM=; b=dl+Bqdy8svR7JQS+qjOjJsWyFEijYaG8Ciwvt0LC8BruY2S52ofNQe3gQm2058Cir0 SiZ8Emii+MJiBEktQyPHlViGZHS76oBI57X5GX7vsrh9DDAbBuCDeDusN7HcqgMOoN+V dCOA8xZLMP5Dsg5atplQ1LYGNgxfJHI09Otx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=gCmtiqrEIlMBDg1i/PP5Z/EThk7GTRI1ZQms33WQSrRhpoAQqZMh4gDRra9gLkOs7E NplRVh+dIbRU9jlF+talHEFnd3thurh14Fn6//5/Btqi4x9kgt/Pu21qmCSgU4ev9nza gm5ypXwZAhg5H8xCLOOgii9IYZl46eZ6hJVN8= Received: by 10.102.182.6 with SMTP id e6mr2415630muf.63.1265018476992; Mon, 01 Feb 2010 02:01:16 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id s10sm14582853muh.29.2010.02.01.02.01.15 (version=SSLv3 cipher=RC4-MD5); Mon, 01 Feb 2010 02:01:15 -0800 (PST) Sender: Alexander Motin Message-ID: <4B66A669.2070406@FreeBSD.org> Date: Mon, 01 Feb 2010 12:01:13 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> In-Reply-To: <20100201092334.GB1743@garage.freebsd.pl> X-Enigmail-Version: 0.96.0 Content-Type: multipart/mixed; boundary="------------020500080902030103010007" Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , kib@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 10:11:23 -0000 This is a multi-part message in MIME format. --------------020500080902030103010007 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Pawel Jakub Dawidek wrote: > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: >> Maybe I'll add how I understand what's going on: >> >> GEOM calls destroy_dev() while holding the topology lock. >> >> Destroy_dev() wants to destroy device, but can't because there are >> threads that still have it open. >> >> The threads can't close it, because to close it they need the topology >> lock. >> >> The deadlock is quite obvious, IMHO. > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > the problem for me (at least it makes race window so small that I can't > reproduce it). Is there anyone who isn't happy with such a change? Have you done some locking there? Because my system crashes with such straightforward change, when g_dev_close() called after geom node being destroyed. Attached patch fixes that for me, but I have doubts that it is complete. There is still seems to be a race with new I/O requests and ioctl's, that are not protected by topology lock. At least if devfs code doesn't handle it somehow. -- Alexander Motin --------------020500080902030103010007 Content-Type: text/plain; name="geom_dev.destroy.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="geom_dev.destroy.patch" --- geom_dev.c.prev 2010-01-30 05:22:36.000000000 +0200 +++ geom_dev.c 2010-02-01 11:55:53.000000000 +0200 @@ -184,10 +184,13 @@ g_dev_close(struct cdev *dev, int flags, struct g_consumer *cp; int error, r, w, e, i; + g_topology_lock(); gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL) + if (gp == NULL || cp == NULL) { + g_topology_unlock(); return(ENXIO); + } g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)", gp->name, flags, fmt, td); r = flags & FREAD ? -1 : 0; @@ -197,7 +200,6 @@ g_dev_close(struct cdev *dev, int flags, #else e = 0; #endif - g_topology_lock(); if (dev->si_devsw == NULL) error = ENXIO; /* We were orphaned */ else @@ -435,7 +437,10 @@ g_dev_orphan(struct g_consumer *cp) set_dumper(NULL); /* Destroy the struct cdev *so we get no more requests */ - destroy_dev(dev); + gp->softc = NULL; + dev->si_drv1 = NULL; + dev->si_drv2 = NULL; + destroy_dev_sched(dev); /* Wait for the cows to come home */ while (cp->nstart != cp->nend) --------------020500080902030103010007-- From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 11:06:56 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4421065679 for ; Mon, 1 Feb 2010 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 122E38FC20 for ; Mon, 1 Feb 2010 11:06:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o11B6t6b062796 for ; Mon, 1 Feb 2010 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o11B6t51062794 for freebsd-geom@FreeBSD.org; Mon, 1 Feb 2010 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 1 Feb 2010 11:06:55 GMT Message-Id: <201002011106.o11B6t51062794@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 11:06:56 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/142563 geom [geom] [hang] ioctl freeze in zpool f kern/142365 geom [geom] FreeBSD RAID1 (gmirror) is much slower than Lin o kern/141740 geom [geom] gjournal(8): g_journal_destroy concurrent error o kern/140352 geom [geom] gjournal + glabel not working o kern/139847 geom [geom_mbr] load/unload causes system to hang o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used f kern/126902 geom [geom] geom_label: kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s f kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 54 problems total. From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 11:08:55 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30DBF10656E4; Mon, 1 Feb 2010 11:08:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6720F8FC20; Mon, 1 Feb 2010 11:08:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o11B8Z5S048484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Feb 2010 13:08:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id o11AhSRO031239; Mon, 1 Feb 2010 12:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o11AhSXE031205; Mon, 1 Feb 2010 12:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 1 Feb 2010 12:43:28 +0200 From: Kostik Belousov To: Alexander Motin Message-ID: <20100201104328.GD15587@deviant.kiev.zoral.com.ua> References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> <4B66A669.2070406@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xB0nW4MQa6jZONgY" Content-Disposition: inline In-Reply-To: <4B66A669.2070406@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , Pawel Jakub Dawidek , freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 11:08:55 -0000 --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 01, 2010 at 12:01:13PM +0200, Alexander Motin wrote: > Pawel Jakub Dawidek wrote: > > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > >> Maybe I'll add how I understand what's going on: > >> > >> GEOM calls destroy_dev() while holding the topology lock. > >> > >> Destroy_dev() wants to destroy device, but can't because there are > >> threads that still have it open. > >> > >> The threads can't close it, because to close it they need the topology > >> lock. > >> > >> The deadlock is quite obvious, IMHO. > >=20 > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > > the problem for me (at least it makes race window so small that I can't > > reproduce it). Is there anyone who isn't happy with such a change? >=20 > Have you done some locking there? Because my system crashes with such > straightforward change, when g_dev_close() called after geom node being > destroyed. Attached patch fixes that for me, but I have doubts that it > is complete. There is still seems to be a race with new I/O requests and > ioctl's, that are not protected by topology lock. At least if devfs code > doesn't handle it somehow. Devfs prevents new threads from entering cdevsw methods after destroy_dev_sched() is called. It is driver responsibility to take care about other code pathes that may access cdev. --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktmsFAACgkQC3+MBN1Mb4hNzQCg2m16aRPIrgVnePtnZj0tCrYU AqYAoJZ0iO6X7ivDvPxIgD5rdeEuLje/ =7DeA -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY-- From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 20:16:24 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ACC81065672 for ; Mon, 1 Feb 2010 20:16:24 +0000 (UTC) (envelope-from nonsolosoft@diff.org) Received: from smtpi3.ngi.it (smtpi3.ngi.it [88.149.128.33]) by mx1.freebsd.org (Postfix) with ESMTP id CE5928FC14 for ; Mon, 1 Feb 2010 20:16:23 +0000 (UTC) Received: from lap.diff.org (81-174-26-135.static.ngi.it [81.174.26.135]) by smtpi3.ngi.it (Postfix) with ESMTP id 0F6F4318181 for ; Mon, 1 Feb 2010 21:16:18 +0100 (CET) Message-ID: <4B673692.4070408@diff.org> Date: Mon, 01 Feb 2010 21:16:18 +0100 From: Ferruccio Zamuner Organization: NonSoLoSoft User-Agent: Thunderbird 2.0.0.16 (X11/20080917) MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: multipart/mixed; boundary="------------000509040609060504060606" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: system freeze on freebsd 8.0-stable and gmirror/gjournal X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 20:16:24 -0000 This is a multi-part message in MIME format. --------------000509040609060504060606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm moving to a new server dedicated hosts. I've choose to install FreeBSD 8.0 and I've already upgrade to -stable. I've two hd sata 160Gb each: ad4, ad6. I've split them in two slices: ad[46]s1, ad[46]s2. gmirror ad*s1 -> gm0 gstripe ad*s2 -> gs0 then I've applied gjournal to both of them and finally I've partitioned, Filesystem Size Used Avail Capacity Mounted on /dev/mirror/gmir0.journala 989M 688M 222M 76% / /dev/mirror/gmir0.journalb 3GB /dev/mirror/gmir0.journald 5.8G 3.0M 5.3G 0% /tmp /dev/mirror/gmir0.journale 9.7G 1.9G 7.0G 22% /var /dev/mirror/gmir0.journalf 7.7G 3.5G 3.6G 49% /usr /dev/mirror/gmir0.journalg 88G 20G 61G 25% /home /dev/stripe/gs0.journald 55G 25G 26G 48% /faster1 > swapinfo Device 1K-blocks Used Avail Capacity /dev/mirror/gmir0.journalb 3047152 28 3047124 0% > uname -a FreeBSD myc.diff.org 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Jan 30 02:52:28 CET 2010 Ram: 1Gb The cpu is Athlon x64 3200+ Then problem: everytime it need to swap, the system freeze and I've to reset to make it return managed over ssh. Is GEOM so bad to make this trouble? Any other idea? Best regards, \ferz --------------000509040609060504060606-- From owner-freebsd-geom@FreeBSD.ORG Mon Feb 1 20:30:54 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95C821065670 for ; Mon, 1 Feb 2010 20:30:54 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id C8EDE8FC13 for ; Mon, 1 Feb 2010 20:30:53 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 772C045D8D; Mon, 1 Feb 2010 21:30:41 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6B5A345CD8; Mon, 1 Feb 2010 21:30:35 +0100 (CET) Date: Mon, 1 Feb 2010 21:30:25 +0100 From: Pawel Jakub Dawidek To: Ferruccio Zamuner Message-ID: <20100201203025.GA1732@garage.freebsd.pl> References: <4B673692.4070408@diff.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <4B673692.4070408@diff.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: system freeze on freebsd 8.0-stable and gmirror/gjournal X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 20:30:54 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 01, 2010 at 09:16:18PM +0100, Ferruccio Zamuner wrote: > Hello, >=20 > I'm moving to a new server dedicated hosts. > I've choose to install FreeBSD 8.0 and I've already upgrade to -stable. >=20 > I've two hd sata 160Gb each: ad4, ad6. >=20 > I've split them in two slices: ad[46]s1, ad[46]s2. >=20 > gmirror ad*s1 -> gm0 > gstripe ad*s2 -> gs0 >=20 > then I've applied gjournal to both of them and finally I've partitioned, >=20 > Filesystem Size Used Avail Capacity =20 > Mounted on > /dev/mirror/gmir0.journala 989M 688M 222M 76% / > /dev/mirror/gmir0.journalb 3GB > /dev/mirror/gmir0.journald 5.8G 3.0M 5.3G 0% /tmp > /dev/mirror/gmir0.journale 9.7G 1.9G 7.0G 22% /var > /dev/mirror/gmir0.journalf 7.7G 3.5G 3.6G 49% /usr > /dev/mirror/gmir0.journalg 88G 20G 61G 25% /ho= me > /dev/stripe/gs0.journald 55G 25G 26G 48% =20 > /faster1 >=20 > > swapinfo > Device 1K-blocks Used Avail Capacity > /dev/mirror/gmir0.journalb 3047152 28 3047124 0% It is very bad idea to swap onto gjournal, but the more important thing is that there should be one gjournal provider for one file system, not one gjournal provider for multiple file systems. Also file system should be placed directly on gjournal provider and you have partitions configured even in gs0 case. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLZznhForvXbEpPzQRAjIMAKCcuZa97v7SLmMiv8T6v/6mft67vACgmmsb JgYbPOoVdPLsxG33Du56Voc= =+WnJ -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU-- From owner-freebsd-geom@FreeBSD.ORG Tue Feb 2 00:07:18 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821A6106566C; Tue, 2 Feb 2010 00:07:18 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 590D28FC19; Tue, 2 Feb 2010 00:07:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o1207IiJ057229; Tue, 2 Feb 2010 00:07:18 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o1207IWj057225; Tue, 2 Feb 2010 00:07:18 GMT (envelope-from linimon) Date: Tue, 2 Feb 2010 00:07:18 GMT Message-Id: <201002020007.o1207IWj057225@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-geom@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/143455: gstripe(8) in RELENG_8 (31st Jan 2010) broken X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 00:07:18 -0000 Old Synopsis: gstripe in RELENG_8 (31st Jan 2010) broken New Synopsis: gstripe(8) in RELENG_8 (31st Jan 2010) broken Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: linimon Responsible-Changed-When: Tue Feb 2 00:06:38 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=143455 From owner-freebsd-geom@FreeBSD.ORG Tue Feb 2 08:30:04 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 405741065670 for ; Tue, 2 Feb 2010 08:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1647C8FC12 for ; Tue, 2 Feb 2010 08:30:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o128U3kG024238 for ; Tue, 2 Feb 2010 08:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o128U3v6024229; Tue, 2 Feb 2010 08:30:03 GMT (envelope-from gnats) Date: Tue, 2 Feb 2010 08:30:03 GMT Message-Id: <201002020830.o128U3v6024229@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Patrick Mackinlay Cc: Subject: Re: kern/143455: gstripe(8) in RELENG_8 (31st Jan 2010) broken X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Patrick Mackinlay List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 08:30:04 -0000 The following reply was made to PR kern/143455; it has been noted by GNATS. From: Patrick Mackinlay To: bug-followup@FreeBSD.org, patrick@spacesurfer.com Cc: Subject: Re: kern/143455: gstripe(8) in RELENG_8 (31st Jan 2010) broken Date: Tue, 02 Feb 2010 08:03:09 +0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5B8DD535B9C38E9141A5ECC9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am guessing this is related to the commit: http://svn.freebsd.org/viewvc/base?view=3Drevision&revision=3D202425 If so please add some notes to UPDATING detailing the changes and how they will affect an upgrade. regards, Patrick --=20 Patrick Mackinlay patrick@spacesurfer.com http://patrick.spacesurfer.com/ tel: +44.7050699851 Yahoo messenger: patrick00_uk fax: +44.7050699852 SpaceSurfer Limited http://www.spacereg.com/ --------------enig5B8DD535B9C38E9141A5ECC9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFLZ9xED97IpyzY3RIRAtpTAKCBv7ZraePL0Uz/z/HymRBTffSNWwCdEawS hAJCHgdSvxFPlge/sr8lYAM= =wYcP -----END PGP SIGNATURE----- --------------enig5B8DD535B9C38E9141A5ECC9-- From owner-freebsd-geom@FreeBSD.ORG Tue Feb 2 10:20:05 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C80C106566C for ; Tue, 2 Feb 2010 10:20:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 531E88FC13 for ; Tue, 2 Feb 2010 10:20:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o12AK5Gq019996 for ; Tue, 2 Feb 2010 10:20:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o12AK50D019995; Tue, 2 Feb 2010 10:20:05 GMT (envelope-from gnats) Date: Tue, 2 Feb 2010 10:20:05 GMT Message-Id: <201002021020.o12AK50D019995@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Ivan Voras Cc: Subject: Re: kern/143455: gstripe(8) in RELENG_8 (31st Jan 2010) broken X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ivan Voras List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 10:20:05 -0000 The following reply was made to PR kern/143455; it has been noted by GNATS. From: Ivan Voras To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/143455: gstripe(8) in RELENG_8 (31st Jan 2010) broken Date: Tue, 02 Feb 2010 11:08:11 +0100 The OP in the PR is using "gstripe create" instead of "gstripe label" and now probably has mismatched stripe sizes. Manually specifying the old size (4096) should fix it.