* The -c option of btrfs qgroup limit
@ 2013-03-26 23:36 Koen De Wit
2013-03-27 6:18 ` Jan Schmidt
0 siblings, 1 reply; 3+ messages in thread
From: Koen De Wit @ 2013-03-26 23:36 UTC (permalink / raw)
To: linux-btrfs
All,
The "btrfs qgroup limit" command has an option -c which means "limit amount
of data after compression". Whether this option is specified or not, I seem
to be able to write more well-compressible data than the specified limit. I
was expecting that omitting the -c option would never allow me to write
more data than specified by the limit. Am I missing something? Which
difference in behavior should I expect from the -c option?
Koen.
---
This is what I did:
Mount a btrfs filesystem with the compress option and turn on quota:
# mkfs.btrfs -f /dev/sdg2
# mount -o compress /dev/sdg2 /mnt
# cd /mnt
# btrfs quota enable ./
Create a subvol and limit the amount of data after compression. Write some
well-compressible files:
# btrfs subvol create subvol1
# btrfs qgroup limit -c 3m ./subvol1
# for i in `seq 1 5`; do
dd if=/dev/zero of=subvol1/file$i bs=1024 count=1000;
sync;
done
(no errors)
# du -s subvol1
5000 subvol1
We can write 5 MB of data to a file that is limited to 3 MB, which is
normal
in this case because data from /dev/zero is very good compressible.
Create a subvol and limit the amount of data after compression. Write some
poorly compressible files:
# btrfs subvol create subvol2
# btrfs qgroup limit -c 3m ./subvol2
# for i in `seq 1 5`; do
dd if=/dev/urandom of=subvol2/file$i bs=1024 count=1000;
sync;
done
dd: writing `subvol2/file4': Disk quota exceeded
dd: opening `subvol2/file5': Disk quota exceeded
# du -s subvol2
3056 subvol2
Here we get quota violations, because data from /dev/urandom is poorly
compressible.
Now write some well-compressible data to a subvol that is limited without
the -c option:
# btrfs subvol create subvol3
# btrfs qgroup limit 3m ./subvol3
# for i in `seq 1 5`; do
dd if=/dev/zero of=subvol3/file$i bs=1024 count=1000;
sync;
done
(no errors)
# du -s subvol3
5000 subvol3
We're still able to write 5 MB of data to a subvol that is limited to 3 MB.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: The -c option of btrfs qgroup limit
2013-03-26 23:36 The -c option of btrfs qgroup limit Koen De Wit
@ 2013-03-27 6:18 ` Jan Schmidt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Schmidt @ 2013-03-27 6:18 UTC (permalink / raw)
To: Koen De Wit; +Cc: linux-btrfs
Hi Koen,
On 27.03.2013 00:36, Koen De Wit wrote:
> The "btrfs qgroup limit" command has an option -c which means "limit amount
> of data after compression". Whether this option is specified or not, I seem
> to be able to write more well-compressible data than the specified limit. I
> was expecting that omitting the -c option would never allow me to write
> more data than specified by the limit. Am I missing something? Which
> difference in behavior should I expect from the -c option?
Today: none. In the future: The one you describe. That option is planned
but not implemented. We should have mentioned that in the qgroup usage,
I agree.
-Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* The -c option of btrfs qgroup limit
@ 2013-03-27 6:44 Wang Shilong
0 siblings, 0 replies; 3+ messages in thread
From: Wang Shilong @ 2013-03-27 6:44 UTC (permalink / raw)
To: Koen De Wit; +Cc: linux-btrfs
Hello Koen,
Although we offer '-c' option for btrfs qgroup limit,
it has been not implemented yet.
So until now, btrfs quota just limits the real space
that writes to the space.
Thanks,
Wang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-27 6:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 23:36 The -c option of btrfs qgroup limit Koen De Wit
2013-03-27 6:18 ` Jan Schmidt
2013-03-27 6:44 Wang Shilong
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.