@@ -127,6 +127,46 @@ If no prefix is given, use ascending order by default.
+
If multiple <attr>s is given, use comma to separate.
+EXTRA NOTES
+-----------
+1. Need sync before *btrfs qgroup show* command
++
+Sync is needed to output correct numbers, especially after kernel v4.2.
+
+2. Copy-on-write(CoW) may cause extra space usage
++
+Cow will cause extra space usage, compared to overwrite filesystem, like ext4
+or xfs.
++
+Here is a example, for a file with 12K contents:
++
+--------------------------------------
+File1:
+0 4K 8K 12K
+|<-------Extent A------>|
+--------------------------------------
++
+It takes 12K space.
++
+But after a rewrite of the 4K in the middle: +
++
+--------------------------------------
+File1:
+0 4K 8K 12K
+|<-------Extent A------>|
+ |<--B-->|
+--------------------------------------
++
+New extent B will record the new data, although the original extent A still
+exists, until none part of it is referred. +
+So in this case, it will take 12 + 4 = 16K, other than 12K as a traditional
+filesystem.
++
+The overhead can be reduced by either using *nodatacow* mount option to disable
+possible COW or defrag. +
+But it won't completely remove the extra space usage when snapshot/subvolume is
+involved.
+
EXIT STATUS
-----------
*btrfs qgroup* returns a zero exit status if it succeeds. Non zero is
Add extra explaination on btrfs qgroup on the following two things: 1) Need sync to show accurate qgroup numbers 2) Cow may cause extra quota usage Although btrfs qgroup is still buggy, especially for limit behavior, but some strange behavior is not really a bug. Just add these explaination for end users if they really want to try it. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- Documentation/btrfs-qgroup.asciidoc | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)