From owner-freebsd-fs@FreeBSD.ORG Sat Nov 10 20:36:19 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 8DB72C96 for ; Sat, 10 Nov 2012 20:36:19 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 46A4C8FC08 for ; Sat, 10 Nov 2012 20:36:18 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so6413528oag.13 for ; Sat, 10 Nov 2012 12:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hqN78dtA5NWeT7rMohuGw/9qDXkWpWexxMnkU7m7xcs=; b=RCWHoy/kwEk/nBigkaIZOWj44MAmbbZHn2Qyg4vKhQ5AqI5UeQFvipyhm857rsUcyI EeZkbYeLRBs9v2oI087hJimyIi6yFBO8kXlbzOQOq/05BpNZBFwEds8nPpwUvY23r5Qv y9aJ6skoLNlOvYmie22oqY/03FQSh1QCbUzBGnSR4c90PvsIEd3WtipmqQdNXyWWBccm 6jsxZYsFcrMK3Ldo/DY/doHYmO0Owhr1G2XpZmAx1Qr0APRDt6VI5mF9XcplEgw6PK/T /zbT2z2tU0h/SslL29MNnSd7xyFJsNqkK3C7nE9AJRAQCaHkCLDqh6tMDE6BlQE3V1B7 s5og== MIME-Version: 1.0 Received: by 10.60.32.137 with SMTP id j9mr11373835oei.133.1352579778397; Sat, 10 Nov 2012 12:36:18 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 10 Nov 2012 12:36:18 -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> Date: Sat, 10 Nov 2012 12:36:18 -0800 Message-ID: Subject: Re: ZFS can't delete files when over quota From: Garrett Cooper To: Kevin Day Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:36:19 -0000 On Sat, Nov 10, 2012 at 12:29 PM, 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 > here. > > > > Something like: > > > > http://people.freebsd.org/~bdrewery/rm-quota.txt > > > > Bryan > > > This also may cause unintended or weird behavior with regard to > open/running 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 > space isn't actually freed until after everything holding the old version > exits. With the patch, truncate will fail with ETXTBSY. Having rm fail with > ETXTBSY 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 > contents of it until after everyone is done with it. Throwing a truncate in > there 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 > make some hard to debug situations occur. > > Also, you need to be testing errno == EDQUOT, not rval. > Yes. unlink(...) == -1 && errno == EDQUOT