From owner-freebsd-stable@FreeBSD.ORG Wed Apr 26 16:44:01 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2162416A410 for ; Wed, 26 Apr 2006 16:44:01 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09F3F43D5E for ; Wed, 26 Apr 2006 16:43:57 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AD4D952BC5; Wed, 26 Apr 2006 18:43:55 +0200 (CEST) Received: from localhost (dlp28.neoplus.adsl.tpnet.pl [83.24.45.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 2133552C73; Wed, 26 Apr 2006 18:43:49 +0200 (CEST) Date: Wed, 26 Apr 2006 18:42:28 +0200 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20060426164228.GB17000@garage.freebsd.pl> References: <20060425080932.1rv9hq0rcws4wc84@www.wolves.k12.mo.us> <20060425133532.GD1446@deviant.kiev.zoral.com.ua> <20060425095610.ibv24kg1kw00s040@www.wolves.k12.mo.us> <20060425185741.C71240@woozle.rinet.ru> <20060425153909.GE1446@deviant.kiev.zoral.com.ua> <20060425162252.GA54244@xor.obsecurity.org> <444EC8EA.8050305@asd.aplus.net> <20060426011703.GA61794@xor.obsecurity.org> <20060426134217.C93749@woozle.rinet.ru> <20060426133617.GG1446@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline In-Reply-To: <20060426133617.GG1446@deviant.kiev.zoral.com.ua> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r535 (FreeBSD) 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.5 required=3.0 tests=BAYES_00,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-stable@freebsd.org, Dmitry Morozovsky , Kris Kennaway Subject: Re: fsck_ufs locked in snaplk X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 16:44:01 -0000 --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 26, 2006 at 04:36:17PM +0300, Kostik Belousov wrote: +> On Wed, Apr 26, 2006 at 01:43:42PM +0400, Dmitry Morozovsky wrote: +> > On Tue, 25 Apr 2006, Kris Kennaway wrote: +> >=20 +> > KK> What people are seeing now must be some other problem that I wan't +> > KK> able to reproduce. +> > KK>=20 +> > KK> Once I hear back from someone who can reproduce it with debugging +> > KK> enabled (I'm also trying) we can try to fix it. +> >=20 +> > Please try to simulate user who is over soft quota and is out of grace= period.=20 +> > I'm trying to do so as well, but currently quite busy with other tasks= :( +>=20 +> I'm not sure whether the following is the issue you met, but: +>=20 +> dqsync from sys/ufs/ufs/ufs_quota.c calls vn_start_secondary_write() +> unconditionally. As result, mp->mnt_secondary_accwrites counter +> from the struct mount will always increase after the entry to the dqsync. +> ffs_snapshot calls ffs_sync, that calls dsync, that +> iterates over vnodes and calls dqsync on them. +> And, after the qsync, ffs_sync checks whether mp->mnt_secondary_accwrites +> changes by calling softdep_check_suspend (see line 1221 of ffs_vfsops.c). +> If changed, ffs_sync would restart the syncing loop, that never finishes. +>=20 +> This is very strange, since if true, it basicaly means that snapshots +> and quotas shall lead to immediate deadlock ... +>=20 +> The following patch moves call to vn_start_secondary_write after +> check for DQ_MOD. Please, try it. Your patch must not be against HEAD, because in HEAD we have: if ((dq->dq_flags & DQ_MOD) =3D=3D 0) return (0); if ((dqvp =3D dq->dq_ump->um_quotas[dq->dq_type]) =3D=3D NULLVP) panic("dqsync: file"); (void) vn_start_secondary_write(dqvp, &mp, V_WAIT); if (vp !=3D dqvp) vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); As you can see DQ_MOD is checked before vn_start_secondary_write(). --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFET6L0ForvXbEpPzQRAqHTAJsEXuzi+DdJHHcGxQAqgmSs2vgpfgCgoXx0 XrGaLM60Xc+fdluNSunFsBY= =C5+u -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv--