From owner-freebsd-fs@FreeBSD.ORG Sat Nov 10 20:29:51 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 B0467A3F for ; Sat, 10 Nov 2012 20:29:51 +0000 (UTC) (envelope-from toasty@dragondata.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 60FA38FC0A for ; Sat, 10 Nov 2012 20:29:50 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id k10so9650580iea.13 for ; Sat, 10 Nov 2012 12:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dragondata.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=bUt6aJMQ7IlxpYz6BgstXMubAZkBz0xA4MQKDvkFI9k=; b=Fd9fZJlx4drKxSJpnoDIp5ZfwgSvTl06Vm/sVHH20yPYdol9rGZ807lIWdnEUQtK+G y8thhWTsohtk13ZsNwjfxo5RdK/jdXIw04XzFsWG9i8has/xzV+jW8p006hqpu7lfxW4 BUptRFoqeo8yWOZuEKd31jd9PejSHh/XFku2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=bUt6aJMQ7IlxpYz6BgstXMubAZkBz0xA4MQKDvkFI9k=; b=gMX/cH0yhgbYx1FRp8hnvb/I1ofdBiapMpLynQfS/wZYIyv6GV6Y45GUXOCZUz0ovl 1WSD8oZxhBI8pymtMF7F81ZhTInKdxOzUt/jymQ8+VlvowvN1gKXAaNPINU4HjkmIrhR 7FzogAOIswCw47z1r3rljnEHik7VJE2bJa7NPn3TzCLFnxsH5zY0qni8Tx4+oruDCVHM +gRAKlq0EgN51Qjjpqnk2VdWDbAVWGyT4WQ5ZVjpyoIXh9YLTB1Ij8Cmfe4dLtQbNrMD lYUGY66HnaBFmezEOtkGJ1GlzuWUOr1HVoFFfoikn5z5Q7bxovxQEc/Yp6M7K4ZxwBYC JUmA== Received: by 10.50.213.99 with SMTP id nr3mr4121202igc.16.1352579390419; Sat, 10 Nov 2012 12:29:50 -0800 (PST) Received: from unassigned.v6.your.org ([2001:4978:1:45:15a1:f03b:726b:c856]) by mx.google.com with ESMTPS id kp4sm2075142igc.1.2012.11.10.12.29.48 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Nov 2012 12:29:49 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: ZFS can't delete files when over quota From: Kevin Day In-Reply-To: <509EA942.9060801@shatow.net> Date: Sat, 10 Nov 2012 14:29:46 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <67C1C89F-4A91-4595-8EA7-19AF3EC4656F@dragondata.com> References: <509E79C7.10300@shatow.net> <509EA942.9060801@shatow.net> To: Bryan Drewery X-Mailer: Apple Mail (2.1499) X-Gm-Message-State: ALoCoQnBnJQCOkGHYrz+nVyxHT8OQdvfr+reVLAtEcsB9DF7pbwTadkLkr2Yb3mYjMxl6tONnCS/ Cc: "freebsd-fs@freebsd.org" 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:29:52 -0000 On Nov 10, 2012, at 1:21 PM, Bryan Drewery wrote: > On 11/10/2012 12:55 PM, Chris Rees wrote: >> Bryan, >>=20 >> Please try the patch at [1]; if it works I'll document it. >>=20 >> Chris >>=20 >> [1] http://www.bayofrum.net/~crees/patches/bdrewery.diff >>=20 >=20 > Hmm, I'm not a fan of -T. I think it should just work out-of-the-box = here. >=20 > Something like: >=20 > http://people.freebsd.org/~bdrewery/rm-quota.txt >=20 > 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 =3D=3D EDQUOT, not rval. -- Kevin