From owner-freebsd-fs@FreeBSD.ORG Sat Nov 10 20:37:06 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10DB2E22 for ; Sat, 10 Nov 2012 20:37:06 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 875B48FC12 for ; Sat, 10 Nov 2012 20:37:05 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jm19so986864bkc.13 for ; Sat, 10 Nov 2012 12:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=s3DhBzZhY78lxgky5EVXIsLS45CQ9MruaiiiuMQJlNM=; b=WeQTON0AR8qYFDQ8bcwjG59KZNEY6YGqU91p+b3hXiIeb5Z/dRthRYJmSkWhLfa6mX lr8MprfrIxRjJlLE8l7RbtFQ3RDk5HFlxDGagSiXbGC9B6lcrjmX3OHOo03mQ+SI0oCo rVd0qVKZkzB5hyP/fUX2a/QuE5LTMJsRhZZYZGYB31TCtAuhDBfYPmlZXmr5dGbClzu/ yn8yoF+Tm6aO8ehTzVJuIrIu4+untTy9fHl3GWho4tAS5ecKsedGXVBgc27w/GaYQbwF wrp9fFqaWPCgWIju4OnRLkXrzjkkXAYM0qj3yBX9IRmhsceQ75pOx5UKaMKho1ArrMrF w+Vg== Received: by 10.204.11.208 with SMTP id u16mr1093130bku.81.1352579824452; Sat, 10 Nov 2012 12:37:04 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.50.197 with HTTP; Sat, 10 Nov 2012 12:36:34 -0800 (PST) In-Reply-To: <67C1C89F-4A91-4595-8EA7-19AF3EC4656F@dragondata.com> References: <509E79C7.10300@shatow.net> <509EA942.9060801@shatow.net> <67C1C89F-4A91-4595-8EA7-19AF3EC4656F@dragondata.com> From: Chris Rees Date: Sat, 10 Nov 2012 20:36:34 +0000 X-Google-Sender-Auth: xrO0xUvyDOu77ewt79guDT7YCy0 Message-ID: Subject: Re: ZFS can't delete files when over quota To: Kevin Day Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-fs@freebsd.org" , Bryan Drewery X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 20:37:06 -0000 On 10 November 2012 20:29, Kevin Day wrote: > > On Nov 10, 2012, at 1:21 PM, Bryan Drewery wrote: > >> On 11/10/2012 12:55 PM, Chris Rees wrote: >>> Bryan, >>> >>> Please try the patch at [1]; if it works I'll document it. >>> >>> Chris >>> >>> [1] http://www.bayofrum.net/~crees/patches/bdrewery.diff >>> >> >> Hmm, I'm not a fan of -T. I think it should just work out-of-the-box her= e. >> >> Something like: >> >> http://people.freebsd.org/~bdrewery/rm-quota.txt >> >> Bryan > > > This also may cause unintended or weird behavior with regard to open/runn= ing binaries or processes that want to keep a file open. > > If you're trying to rm a binary that's currently in use, this is normally= a supported feature. Old copies of the binary keep running and the disk sp= ace isn't actually freed until after everything holding the old version exi= ts. With the patch, truncate will fail with ETXTBSY. Having rm fail with ET= XTBSY is probably wrong. > > Programs are also allowed to keep reading/writing to a file that another = process has unlinked. Unlinking a file is not supposed to destroy the conte= nts of it until after everyone is done with it. Throwing a truncate in ther= e changes that behavior. > > I realize this is only happening under already broken circumstances, but = changing unlink to occasionally doing unlink-truncate-unlink is going to ma= ke some hard to debug situations occur. > > Also, you need to be testing errno =3D=3D EDQUOT, not rval. These are the reasons I added the -T option, which I realise would have been more correct as -t; it's undesirable to have as default behaviour. In my patch, errno is tested. Chris