Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Nov 2012 20:36:34 +0000
From:      Chris Rees <crees@FreeBSD.org>
To:        Kevin Day <toasty@dragondata.com>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>, Bryan Drewery <bryan@shatow.net>
Subject:   Re: ZFS can't delete files when over quota
Message-ID:  <CADLo83-mtBnwwB7qXmJ4yNp9LtVtoaqTFvV0MtR5GMrJc_XzZQ@mail.gmail.com>
In-Reply-To: <67C1C89F-4A91-4595-8EA7-19AF3EC4656F@dragondata.com>
References:  <509E79C7.10300@shatow.net> <CADLo83-mZ0v=zXJnHF01%2BtOvCtBWtrOTZpcd-V%2BWTF7qXNMJUg@mail.gmail.com> <CAFMmRNx2Xqo%2B3FZ6cT%2Ben-u26SVAecN%2B9ULfoV==fXRRTG7fDg@mail.gmail.com> <CADLo83_wEvUtYDgzoCoE4oNF7j3AMWe-AX6OvpxM12xd5AzJ7w@mail.gmail.com> <509EA942.9060801@shatow.net> <67C1C89F-4A91-4595-8EA7-19AF3EC4656F@dragondata.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10 November 2012 20:29, Kevin Day <toasty@dragondata.com> wrote:
>
> On Nov 10, 2012, at 1:21 PM, Bryan Drewery <bryan@shatow.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83-mtBnwwB7qXmJ4yNp9LtVtoaqTFvV0MtR5GMrJc_XzZQ>