From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Quota question
Date: Sat, 8 Nov 2014 02:36:51 +0000 (UTC) [thread overview]
Message-ID: <pan$648cb$e6ca8d21$192128f6$95e500d3@cox.net> (raw)
In-Reply-To: CCA13B0E-D1EE-44D8-A634-FD17C2B22C72@free.fr
Cyril Scetbon posted on Fri, 07 Nov 2014 20:06:40 +0100 as excerpted:
> I've made some tests with a newer version of btrfs, and I still have
> issues :(
>
> http://pastebin.com/cycu08LG
>
> I have 2 directories with quotas and a parent qgroup. All have quotas
> limits but something goes wrong. When the parent limit is exceeded I
> have a "Disk quota exceeded" which is what was expecting. However, after
> some tests I can exceed the limits (see line 80 and 84), but after that
> I can nolonger write to disk without getting an error and even if I just
> want to suppress the data !
>
> FYI I'm using this kernel
> https://launchpad.net/ubuntu/+source/linux/3.16.0-25.33
>
> Any idea ? Bug ?
Again admitting that because I don't use quotas personally and don't
follow them closely on btrfs, I'm not exactly the ideal person to be
answering questions on them... but in the absence of someone more
informed taking a shot (which I'd greet with great relief as I'm
definitely out of my comfortable knowledge range at this point)...
Two comments:
1) As I said earlier I believe the btrfs quota rewrite was in the 3.16
kernel series timeframe. Unfortunately I don't know its current status.
You say kernel 3.16.0 (-25.33, which means nothing to me, what I know is
about the mainline Linus kernel and to a bit less of an extent the
official mainline stable kernels), but is the rewrite in that, or in
3.17, or in the coming 3.18, or not yet entirely there at all... that I
simply don't know.
2) What I *DO* know and *CAN* say with quite some confidence is this:
With btrfs being in general a copy-on-write filesystem, even deletes
normally require /some/ space, because the metadata pointing at the file
in question must be rewritten, and that requires free space in ordered to
happen.
IOW, regardless of whether it's quotas or full filesystem constraints
that are limiting space and provoking ENOSPC errors, depending on how bad
an out-of-space condition actually is, even deleting files in ordered to
free more space may be impossible, because the act of deleting files
requires a rewrite and thus triggers a copy-on-write of the metadata
involved, which itself requires some space.
At least in the case of full filesystem ENOSPC errors, the space-related
questions in the FAQ on the btrfs wiki suggest truncating a file first.
Find an existing file that either doesn't matter or that you have a
backup of elsewhere, and echo > filename (or echo >| filename if you have
noclobber set), therefore truncating the existing file. A few of those
and with luck you'll free enough space to do some actual deletions.
While to some extent I'm guessing here since I'm not directly familiar
with quotas myself, it sounds as if such a severe ENOSPC condition, due
in your case to quotas instead of the general filesystem limits I'm more
familiar with, might be what you are seeing, particularly since in your
tests you first triggered the limit, then found a way to write a bit more
anyway, and only THEN found yourself unable to write anything.
If that's the case, then try the truncate trick and see if it helps.
In the generic filesystem case, if the truncate trick doesn't help,
another possible trick is to temporarily add another device of several
gigs capacity to the filesystem, enough to let a balance work and
hopefully reduce the data/metadata imbalance, after which there should be
enough chunk-unallocated free space left on the original device, to do a
btrfs device delete of the temporary device, generally still leaving
space left, since the balance should have reclaimed some otherwise wasted
chunk allocation.
I can't see how that'd apply to quotas, however, and suspect that the
corresponding quota-system solution would be to temporarily up the quota
for the affected user, only long enough to let them do the deletions they
need to do. But beyond that I can't go, since I simply don't know enough
about the quota domain to further speculate, at this point.
While admittedly limited due to my lack of quota-domain knowledge,
perhaps that sheds at least some light on what happened and why, and
hopefully on how to get out of the situation.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2014-11-08 2:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 18:37 Quota question Cyril Scetbon
2014-10-31 8:45 ` Cyril Scetbon
2014-11-01 7:00 ` Duncan
2014-11-01 20:53 ` Cyril Scetbon
2014-11-02 1:53 ` Chris Murphy
2014-11-02 10:42 ` Cyril Scetbon
2014-11-02 21:48 ` Chris Murphy
2014-11-05 20:52 ` Cyril Scetbon
2014-11-07 20:20 ` Christoph Hellwig
2014-11-07 19:06 ` Cyril Scetbon
2014-11-08 2:36 ` Duncan [this message]
2014-11-09 17:55 ` Cyril Scetbon
2014-11-09 22:10 ` Cyril Scetbon
2014-11-12 14:04 ` Cyril Scetbon
2014-11-12 16:01 ` Wang Shilong
2014-11-13 3:05 ` Dongsheng Yang
2014-11-13 9:40 ` Dongsheng Yang
2014-11-13 10:49 ` Cyril Scetbon
-- strict thread matches above, loose matches on Subject: below --
2014-10-30 16:28 Cyril Scetbon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='pan$648cb$e6ca8d21$192128f6$95e500d3@cox.net' \
--to=1i5t5.duncan@cox.net \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.