Re: [BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-24 Thread Kevin Brandstatter

On 07/23/2014 08:23 AM, Josef Bacik wrote:
> On 07/22/2014 08:53 PM, Satoru Takeuchi wrote:
>> Hi Wang,
>>
>> (2014/07/18 19:29), Wang Shilong wrote:
>>> On 07/18/2014 04:45 PM, Satoru Takeuchi wrote:
>>>> Hi Josef, Chris,
>>>>
>>>> I found "Quota Ignored On write" problem still exist with 3.16-rc5,
>>>> which Kevin reported before.
>>>>
>>>> Kevin's report:
>>>> https://urldefense.proofpoint.com/v1/url?u=https://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg35292.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=HiJFypfWVhg2Jy2US%2BNG1tF8q4%2BYUryNKec6yPkYJM4%3D%0A&s=9d1740f5e1701e4906fc04b77d9117052e84d6e16c30971b261d1acf41c10910
>>>>
>>>> The result of bisect:
>>>> https://urldefense.proofpoint.com/v1/url?u=https://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg35304.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=HiJFypfWVhg2Jy2US%2BNG1tF8q4%2BYUryNKec6yPkYJM4%3D%0A&s=75ca6ce24c6d8e64fccdb8f61e519c59b1c6d027140c4f0f5eac24942a53a55d
>>> I guess this is because Josef's patch delayed qgroup accounting, it will
>>> cause @refer and @excl updating very late...
>>>
>>> The patch maybe optimize to merge some delayed refs(for example), but
>>> it updates qgroup accounting when commiting transaction which will be
>>> very late,
>>> we may have accumulated many data..
>> Thank you for your comment. I know of the code logic which caused
>> this problem. However, what I want to say here is that this
>> problem should be fixed as soon as possible. It is a important
>> regression problem and we've already know the root cause.
>>
>> If it's impossible to fix it by releasing 3.16, I consider this
>> patch should be reverted.
>>
> That's not happening.  Qgroups have always been broken in one way or
> another, now with my stuff the accounting is always correct and we don't
> have a huge performance impact with or without qgroups.  We'll fix it
> but there's no way we're reverting this work.  Thanks,
>
> Josef
>
How/when does the accounting happen? Obviously we want the accounting to
be correct, but the overrun seems to indicate that the accounting isn't
happening early enough. From briefly looking at the patches, it looks to
be that the intent is to account when a new extent is allocated, but it
seems that this isn't happening if its still allowed to allocate post
quota, or is the accounting postponed till after a specified time, etc?

-Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-23 Thread Josef Bacik
On 07/22/2014 08:53 PM, Satoru Takeuchi wrote:
> Hi Wang,
> 
> (2014/07/18 19:29), Wang Shilong wrote:
>> On 07/18/2014 04:45 PM, Satoru Takeuchi wrote:
>>> Hi Josef, Chris,
>>>
>>> I found "Quota Ignored On write" problem still exist with 3.16-rc5,
>>> which Kevin reported before.
>>>
>>> Kevin's report:
>>> https://urldefense.proofpoint.com/v1/url?u=https://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg35292.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=HiJFypfWVhg2Jy2US%2BNG1tF8q4%2BYUryNKec6yPkYJM4%3D%0A&s=9d1740f5e1701e4906fc04b77d9117052e84d6e16c30971b261d1acf41c10910
>>>
>>> The result of bisect:
>>> https://urldefense.proofpoint.com/v1/url?u=https://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg35304.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=HiJFypfWVhg2Jy2US%2BNG1tF8q4%2BYUryNKec6yPkYJM4%3D%0A&s=75ca6ce24c6d8e64fccdb8f61e519c59b1c6d027140c4f0f5eac24942a53a55d
>> I guess this is because Josef's patch delayed qgroup accounting, it will
>> cause @refer and @excl updating very late...
>>
>> The patch maybe optimize to merge some delayed refs(for example), but
>> it updates qgroup accounting when commiting transaction which will be
>> very late,
>> we may have accumulated many data..
> 
> Thank you for your comment. I know of the code logic which caused
> this problem. However, what I want to say here is that this
> problem should be fixed as soon as possible. It is a important
> regression problem and we've already know the root cause.
> 
> If it's impossible to fix it by releasing 3.16, I consider this
> patch should be reverted.
> 

That's not happening.  Qgroups have always been broken in one way or
another, now with my stuff the accounting is always correct and we don't
have a huge performance impact with or without qgroups.  We'll fix it
but there's no way we're reverting this work.  Thanks,

Josef

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-22 Thread Wang Shilong
Hi Satoru-san,

On 07/23/2014 08:53 AM, Satoru Takeuchi wrote:
> Hi Wang,
>
> (2014/07/18 19:29), Wang Shilong wrote:
>> On 07/18/2014 04:45 PM, Satoru Takeuchi wrote:
>>> Hi Josef, Chris,
>>>
>>> I found "Quota Ignored On write" problem still exist with 3.16-rc5,
>>> which Kevin reported before.
>>>
>>> Kevin's report:
>>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35292.html
>>>
>>> The result of bisect:
>>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35304.html
>> I guess this is because Josef's patch delayed qgroup accounting, it will
>> cause @refer and @excl updating very late...
>>
>> The patch maybe optimize to merge some delayed refs(for example), but
>> it updates qgroup accounting when commiting transaction which will be
>> very late,
>> we may have accumulated many data..
> Thank you for your comment. I know of the code logic which caused
> this problem. However, what I want to say here is that this
> problem should be fixed as soon as possible. It is a important
> regression problem and we've already know the root cause.
>
> If it's impossible to fix it by releasing 3.16, I consider this
> patch should be reverted.
Since Btrfs Quota function is under heavy development, and should be
considered as *broken*.

I think we'd better close Btrfs quota function(Like snapshot-aware function)
until we really sit down and solve everything.

Thanks,
Wang
>
> Thanks,
> Satoru
>
>> Thanks,
>> Wang
>>>> I bisected and found the bad commit is the following patch.
>>>>
>>>> ===
>>>> commit fcebe4562dec83b3f8d3088d77584727b09130b2
>>>> Author: Josef Bacik 
>>>> Date:   Tue May 13 17:30:47 2014 -0700
>>>>
>>>>  Btrfs: rework qgroup accounting
>>>> ===
>>>>
>>>> Josef, please take a look at this patch.
>>> Reproducer:
>>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35299.html
>>>
>>> Could you tell me the progress of fixing this bug?
>>> In addition, could you fix it by 3.16?
>>>
>>> command log:
>>> ===
>>> # ./test.sh
>>> + uname -a
>>> Linux luna.soft.fujitsu.com 3.16.0-rc5 #2 SMP Tue Jul 15 13:39:46 JST 2014 
>>> x86_64 x86_64 x86_64 GNU/Linux
>>> + df -T /test7
>>> Filesystem Type  1K-blocks  Used Available Use% Mounted on
>>> /dev/sdc7  btrfs  29296640  1536  27169536   1% /test7
>>> + btrfs quota ena /test7
>>> + cd /test7
>>> + btrfs sub cre test
>>> Create subvolume './test'
>>> + btrfs sub l -a /test7
>>> ID 270 gen 66 top level 5 path test
>>> + btrfs qg lim 1G test  # limit test subvol to 1GB
>>> + btrfs qg show -pcre /test7
>>> qgroupid rfer  excl  max_rfer   max_excl parent  child
>>>          --  -
>>> 0/5  16384 16384 0  0--- ---
>>> 0/27016384 16384 1073741824 0--- ---
>>> + dd if=/dev/zero of=test/file0 bs=1M count=2000
>>> 2000+0 records in
>>> 2000+0 records out
>>> 2097152000 bytes (2.1 GB) copied, 9.67876 s, 217 MB/s   # write 2GB. It's a 
>>> bug!
>>> + sync
>>> + ls -lisaR /test7
>>> /test7:
>>> total 20
>>> 256 16 drwxr-xr-x   1 root root8 Jul 18 15:12 .
>>>2  4 drwxr-xr-x. 43 root root 4096 Jul 16 08:34 ..
>>> 256  0 drwxr-xr-x   1 root root   10 Jul 18 15:17 test
>>>
>>> /test7/test:
>>> total 2048016
>>> 256   0 drwxr-xr-x 1 root root 10 Jul 18 15:17 .
>>> 256  16 drwxr-xr-x 1 root root  8 Jul 18 15:12 ..
>>> 257 2048000 -rw-r--r-- 1 root root 2097152000 Jul 18 15:17 file0
>>> + btrfs qg show -pcre /test7
>>> qgroupid rfer   excl   max_rfer   max_excl parent  child
>>>            --  -
>>> 0/5  16384  16384  0  0--- ---
>>> 0/2702097168384 2097168384 1073741824 0--- ---
>>> + btrfs quota dis /test7
>>> + btrfs sub del test
>>> Transaction commit: none (default)
>>> Delete subvolume '/test7/test'
>>> + se

Re: [BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-22 Thread Satoru Takeuchi
Hi Wang,

(2014/07/18 19:29), Wang Shilong wrote:
> On 07/18/2014 04:45 PM, Satoru Takeuchi wrote:
>> Hi Josef, Chris,
>>
>> I found "Quota Ignored On write" problem still exist with 3.16-rc5,
>> which Kevin reported before.
>>
>> Kevin's report:
>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35292.html
>>
>> The result of bisect:
>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35304.html
> I guess this is because Josef's patch delayed qgroup accounting, it will
> cause @refer and @excl updating very late...
> 
> The patch maybe optimize to merge some delayed refs(for example), but
> it updates qgroup accounting when commiting transaction which will be
> very late,
> we may have accumulated many data..

Thank you for your comment. I know of the code logic which caused
this problem. However, what I want to say here is that this
problem should be fixed as soon as possible. It is a important
regression problem and we've already know the root cause.

If it's impossible to fix it by releasing 3.16, I consider this
patch should be reverted.

Thanks,
Satoru

> 
> Thanks,
> Wang
>>
>>> I bisected and found the bad commit is the following patch.
>>>
>>> ===
>>> commit fcebe4562dec83b3f8d3088d77584727b09130b2
>>> Author: Josef Bacik 
>>> Date:   Tue May 13 17:30:47 2014 -0700
>>>
>>>  Btrfs: rework qgroup accounting
>>> ===
>>>
>>> Josef, please take a look at this patch.
>> Reproducer:
>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35299.html
>>
>> Could you tell me the progress of fixing this bug?
>> In addition, could you fix it by 3.16?
>>
>> command log:
>> ===
>> # ./test.sh
>> + uname -a
>> Linux luna.soft.fujitsu.com 3.16.0-rc5 #2 SMP Tue Jul 15 13:39:46 JST 2014 
>> x86_64 x86_64 x86_64 GNU/Linux
>> + df -T /test7
>> Filesystem Type  1K-blocks  Used Available Use% Mounted on
>> /dev/sdc7  btrfs  29296640  1536  27169536   1% /test7
>> + btrfs quota ena /test7
>> + cd /test7
>> + btrfs sub cre test
>> Create subvolume './test'
>> + btrfs sub l -a /test7
>> ID 270 gen 66 top level 5 path test
>> + btrfs qg lim 1G test  # limit test subvol to 1GB
>> + btrfs qg show -pcre /test7
>> qgroupid rfer  excl  max_rfer   max_excl parent  child
>>          --  -
>> 0/5  16384 16384 0  0--- ---
>> 0/27016384 16384 1073741824 0--- ---
>> + dd if=/dev/zero of=test/file0 bs=1M count=2000
>> 2000+0 records in
>> 2000+0 records out
>> 2097152000 bytes (2.1 GB) copied, 9.67876 s, 217 MB/s   # write 2GB. It's a 
>> bug!
>> + sync
>> + ls -lisaR /test7
>> /test7:
>> total 20
>> 256 16 drwxr-xr-x   1 root root8 Jul 18 15:12 .
>>2  4 drwxr-xr-x. 43 root root 4096 Jul 16 08:34 ..
>> 256  0 drwxr-xr-x   1 root root   10 Jul 18 15:17 test
>>
>> /test7/test:
>> total 2048016
>> 256   0 drwxr-xr-x 1 root root 10 Jul 18 15:17 .
>> 256  16 drwxr-xr-x 1 root root  8 Jul 18 15:12 ..
>> 257 2048000 -rw-r--r-- 1 root root 2097152000 Jul 18 15:17 file0
>> + btrfs qg show -pcre /test7
>> qgroupid rfer   excl   max_rfer   max_excl parent  child
>>            --  -
>> 0/5  16384  16384  0  0--- ---
>> 0/2702097168384 2097168384 1073741824 0--- ---
>> + btrfs quota dis /test7
>> + btrfs sub del test
>> Transaction commit: none (default)
>> Delete subvolume '/test7/test'
>> + set +x
>> #
>> ===
>>
>>NOTE:
>>The reproducer here (./test.sh) is a bit different from above-mentioned
>>one because of some reason.
>>
>> Thanks,
>> Satoru
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> .
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-18 Thread Wang Shilong
On 07/18/2014 04:45 PM, Satoru Takeuchi wrote:
> Hi Josef, Chris,
>
> I found "Quota Ignored On write" problem still exist with 3.16-rc5,
> which Kevin reported before.
>
> Kevin's report:
> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35292.html
>
> The result of bisect:
> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35304.html
I guess this is because Josef's patch delayed qgroup accounting, it will
cause @refer and @excl updating very late...

The patch maybe optimize to merge some delayed refs(for example), but
it updates qgroup accounting when commiting transaction which will be
very late,
we may have accumulated many data..

Thanks,
Wang
>
>> I bisected and found the bad commit is the following patch.
>>
>> ===
>> commit fcebe4562dec83b3f8d3088d77584727b09130b2
>> Author: Josef Bacik 
>> Date:   Tue May 13 17:30:47 2014 -0700
>>
>> Btrfs: rework qgroup accounting
>> ===
>>
>> Josef, please take a look at this patch.
> Reproducer:
> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35299.html
>
> Could you tell me the progress of fixing this bug?
> In addition, could you fix it by 3.16?
>
> command log:
> ===
> # ./test.sh
> + uname -a
> Linux luna.soft.fujitsu.com 3.16.0-rc5 #2 SMP Tue Jul 15 13:39:46 JST 2014 
> x86_64 x86_64 x86_64 GNU/Linux
> + df -T /test7
> Filesystem Type  1K-blocks  Used Available Use% Mounted on
> /dev/sdc7  btrfs  29296640  1536  27169536   1% /test7
> + btrfs quota ena /test7
> + cd /test7
> + btrfs sub cre test
> Create subvolume './test'
> + btrfs sub l -a /test7
> ID 270 gen 66 top level 5 path test
> + btrfs qg lim 1G test  # limit test subvol to 1GB
> + btrfs qg show -pcre /test7
> qgroupid rfer  excl  max_rfer   max_excl parent  child
>          --  -
> 0/5  16384 16384 0  0--- ---
> 0/27016384 16384 1073741824 0--- ---
> + dd if=/dev/zero of=test/file0 bs=1M count=2000
> 2000+0 records in
> 2000+0 records out
> 2097152000 bytes (2.1 GB) copied, 9.67876 s, 217 MB/s   # write 2GB. It's a 
> bug!
> + sync
> + ls -lisaR /test7
> /test7:
> total 20
> 256 16 drwxr-xr-x   1 root root8 Jul 18 15:12 .
>   2  4 drwxr-xr-x. 43 root root 4096 Jul 16 08:34 ..
> 256  0 drwxr-xr-x   1 root root   10 Jul 18 15:17 test
>
> /test7/test:
> total 2048016
> 256   0 drwxr-xr-x 1 root root 10 Jul 18 15:17 .
> 256  16 drwxr-xr-x 1 root root  8 Jul 18 15:12 ..
> 257 2048000 -rw-r--r-- 1 root root 2097152000 Jul 18 15:17 file0
> + btrfs qg show -pcre /test7
> qgroupid rfer   excl   max_rfer   max_excl parent  child
>            --  -
> 0/5  16384  16384  0  0--- ---
> 0/2702097168384 2097168384 1073741824 0--- ---
> + btrfs quota dis /test7
> + btrfs sub del test
> Transaction commit: none (default)
> Delete subvolume '/test7/test'
> + set +x
> #
> ===
>
>   NOTE:
>   The reproducer here (./test.sh) is a bit different from above-mentioned
>   one because of some reason.
>
> Thanks,
> Satoru
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> .
>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[BUG] "Quota Ignored On write" problem still exist with 3.16-rc5

2014-07-18 Thread Satoru Takeuchi
Hi Josef, Chris,

I found "Quota Ignored On write" problem still exist with 3.16-rc5,
which Kevin reported before.

Kevin's report:
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35292.html

The result of bisect:
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35304.html

> I bisected and found the bad commit is the following patch.
> 
> ===
> commit fcebe4562dec83b3f8d3088d77584727b09130b2
> Author: Josef Bacik 
> Date:   Tue May 13 17:30:47 2014 -0700
> 
> Btrfs: rework qgroup accounting
> ===
> 
> Josef, please take a look at this patch.

Reproducer:
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg35299.html

Could you tell me the progress of fixing this bug?
In addition, could you fix it by 3.16?

command log:
===
# ./test.sh
+ uname -a
Linux luna.soft.fujitsu.com 3.16.0-rc5 #2 SMP Tue Jul 15 13:39:46 JST 2014 
x86_64 x86_64 x86_64 GNU/Linux
+ df -T /test7
Filesystem Type  1K-blocks  Used Available Use% Mounted on
/dev/sdc7  btrfs  29296640  1536  27169536   1% /test7
+ btrfs quota ena /test7
+ cd /test7
+ btrfs sub cre test
Create subvolume './test'
+ btrfs sub l -a /test7
ID 270 gen 66 top level 5 path test
+ btrfs qg lim 1G test  # limit test subvol to 1GB
+ btrfs qg show -pcre /test7
qgroupid rfer  excl  max_rfer   max_excl parent  child
         --  -
0/5  16384 16384 0  0--- ---
0/27016384 16384 1073741824 0--- ---
+ dd if=/dev/zero of=test/file0 bs=1M count=2000
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 9.67876 s, 217 MB/s   # write 2GB. It's a bug!
+ sync
+ ls -lisaR /test7
/test7:
total 20
256 16 drwxr-xr-x   1 root root8 Jul 18 15:12 .
  2  4 drwxr-xr-x. 43 root root 4096 Jul 16 08:34 ..
256  0 drwxr-xr-x   1 root root   10 Jul 18 15:17 test

/test7/test:
total 2048016
256   0 drwxr-xr-x 1 root root 10 Jul 18 15:17 .
256  16 drwxr-xr-x 1 root root  8 Jul 18 15:12 ..
257 2048000 -rw-r--r-- 1 root root 2097152000 Jul 18 15:17 file0
+ btrfs qg show -pcre /test7
qgroupid rfer   excl   max_rfer   max_excl parent  child
           --  -
0/5  16384  16384  0  0--- ---
0/2702097168384 2097168384 1073741824 0--- ---
+ btrfs quota dis /test7
+ btrfs sub del test
Transaction commit: none (default)
Delete subvolume '/test7/test'
+ set +x
#
===

  NOTE:
  The reproducer here (./test.sh) is a bit different from above-mentioned
  one because of some reason.

Thanks,
Satoru

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Satoru Takeuchi

Hi Josef, Chris, Kevin,

(2014/07/04 12:25), Satoru Takeuchi wrote:

Hi Chris and Kevin,


On 07/03/2014 09:21 PM, Satoru Takeuchi wrote:

Hi Kevin,

(2014/07/04 11:13), Kevin Brandstatter wrote:

basing of the latest for-linus branch i found i can write way more than
the quota

btrfs quota enable
btrfs subvolume create test
btrfs qgruop limit 1G test
dd if=/dev/zero of=test/file bs=1024 count=150
output:
150+0 records in
150+0 records out
153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s

thats a full half gig over the quota limit. I noticed some changes to
the quota
accounting in the logs, what changed that could cause this?


Do you remember what kernel version quota worked correctly?

(2014/07/04 11:32), Satoru Takeuchi wrote:

(2014/07/04 11:25), Kevin Brandstatter wrote:

3.15.3 via arch/ and from linux-git


OK, I'll bisect it.


I made the following reproducer based on your operation.
It succeeded with 3.15 and failed with 3.16-rc3. So, the problematic
patch is not in mason/for-linux branch, but in somewhere between
3.15 and 3.16-rc3. Please wait for a while to finish my bisect...


I bisected and found the bad commit is the following patch.

===
commit fcebe4562dec83b3f8d3088d77584727b09130b2
Author: Josef Bacik 
Date:   Tue May 13 17:30:47 2014 -0700

Btrfs: rework qgroup accounting
===

Josef, please take a look at this patch.

Thanks,
Satoru



===
#!/bin/bash -x

TEST_DEV=/dev/vdb
TEST_MNT=/home/sat/mnt

umount $TEST_MNT
mkfs.btrfs -f $TEST_DEV
mount $TEST_DEV $TEST_MNT
btrfs quota enable $TEST_MNT

SUBVOLPATH=$TEST_MNT/quota_test
LIMIT=$((1024*100))
btrfs subvolume create $SUBVOLPATH
btrfs qgroup limit $LIMIT $SUBVOLPATH
TESTFILE=$SUBVOLPATH/test
dd if=/dev/zero of=$TESTFILE bs=1024 count=$(($LIMIT*3/2/1024))
SIZE=$(($(ls -s $TESTFILE | awk '{print $1}')*1024))

RET=0
if [ $SIZE -le $LIMIT ] ; then
   echo "[PASS] quota works correctly" >&2
else
   echo "[FAIL] quota doesn't work" >&2
   RET=1
fi

exit $RET
===

Thanks,
Satoru



Thanks,
Satoru



-Kevin Brandstatter
--
To unsubscribe from this list: send the line "unsubscribe
linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html





--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Satoru Takeuchi

Hi Chris and Kevin,


On 07/03/2014 09:21 PM, Satoru Takeuchi wrote:

Hi Kevin,

(2014/07/04 11:13), Kevin Brandstatter wrote:

basing of the latest for-linus branch i found i can write way more than
the quota

btrfs quota enable
btrfs subvolume create test
btrfs qgruop limit 1G test
dd if=/dev/zero of=test/file bs=1024 count=150
output:
150+0 records in
150+0 records out
153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s

thats a full half gig over the quota limit. I noticed some changes to
the quota
accounting in the logs, what changed that could cause this?


Do you remember what kernel version quota worked correctly?

(2014/07/04 11:32), Satoru Takeuchi wrote:

(2014/07/04 11:25), Kevin Brandstatter wrote:

3.15.3 via arch/ and from linux-git


OK, I'll bisect it.


I made the following reproducer based on your operation.
It succeeded with 3.15 and failed with 3.16-rc3. So, the problematic
patch is not in mason/for-linux branch, but in somewhere between
3.15 and 3.16-rc3. Please wait for a while to finish my bisect...

===
#!/bin/bash -x

TEST_DEV=/dev/vdb
TEST_MNT=/home/sat/mnt

umount $TEST_MNT
mkfs.btrfs -f $TEST_DEV
mount $TEST_DEV $TEST_MNT
btrfs quota enable $TEST_MNT

SUBVOLPATH=$TEST_MNT/quota_test
LIMIT=$((1024*100))
btrfs subvolume create $SUBVOLPATH
btrfs qgroup limit $LIMIT $SUBVOLPATH
TESTFILE=$SUBVOLPATH/test
dd if=/dev/zero of=$TESTFILE bs=1024 count=$(($LIMIT*3/2/1024))
SIZE=$(($(ls -s $TESTFILE | awk '{print $1}')*1024))

RET=0
if [ $SIZE -le $LIMIT ] ; then
  echo "[PASS] quota works correctly" >&2
else
  echo "[FAIL] quota doesn't work" >&2
  RET=1
fi

exit $RET
===

Thanks,
Satoru



Thanks,
Satoru



-Kevin Brandstatter
--
To unsubscribe from this list: send the line "unsubscribe
linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html





--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Kevin Brandstatter
hmm, is it possible that btrfs is doing some deduplication or compression?
The expected behavior works fine with small quotas like 10/20MB
but at 1GB i can overwrite quite a bit from /dev/zero
I also tried to dd from /dev/urandom (to get some variety other than zeros)
dd if=/dev/urandom of=meow bs=1024 count=150
output:
dd: error writing ‘meow’: Disk quota exceeded
1163330+0 records in
1163329+0 records out
1191248896 bytes (1.2 GB) copied, 110.25 s, 10.8 MB/s

So it looks like its stopping the write, but with a 1GB quota, thats a
20% over quota

-Kevin

On 07/03/2014 09:21 PM, Satoru Takeuchi wrote:
> Hi Kevin,
>
> (2014/07/04 11:13), Kevin Brandstatter wrote:
>> basing of the latest for-linus branch i found i can write way more than
>> the quota
>>
>> btrfs quota enable
>> btrfs subvolume create test
>> btrfs qgruop limit 1G test
>> dd if=/dev/zero of=test/file bs=1024 count=150
>> output:
>> 150+0 records in
>> 150+0 records out
>> 153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s
>>
>> thats a full half gig over the quota limit. I noticed some changes to
>> the quota
>> accounting in the logs, what changed that could cause this?
>
> Do you remember what kernel version quota worked correctly?
>
> Thanks,
> Satoru
>
>>
>> -Kevin Brandstatter
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-btrfs" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Satoru Takeuchi

(2014/07/04 11:25), Kevin Brandstatter wrote:

3.15.3 via arch/ and from linux-git


OK, I'll bisect it.

Satoru



-Kevin

On 07/03/2014 09:21 PM, Satoru Takeuchi wrote:

Hi Kevin,

(2014/07/04 11:13), Kevin Brandstatter wrote:

basing of the latest for-linus branch i found i can write way more than
the quota

btrfs quota enable
btrfs subvolume create test
btrfs qgruop limit 1G test
dd if=/dev/zero of=test/file bs=1024 count=150
output:
150+0 records in
150+0 records out
153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s

thats a full half gig over the quota limit. I noticed some changes to
the quota
accounting in the logs, what changed that could cause this?


Do you remember what kernel version quota worked correctly?

Thanks,
Satoru



-Kevin Brandstatter
--
To unsubscribe from this list: send the line "unsubscribe
linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html





--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Kevin Brandstatter
3.15.3 via arch/ and from linux-git

-Kevin

On 07/03/2014 09:21 PM, Satoru Takeuchi wrote:
> Hi Kevin,
>
> (2014/07/04 11:13), Kevin Brandstatter wrote:
>> basing of the latest for-linus branch i found i can write way more than
>> the quota
>>
>> btrfs quota enable
>> btrfs subvolume create test
>> btrfs qgruop limit 1G test
>> dd if=/dev/zero of=test/file bs=1024 count=150
>> output:
>> 150+0 records in
>> 150+0 records out
>> 153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s
>>
>> thats a full half gig over the quota limit. I noticed some changes to
>> the quota
>> accounting in the logs, what changed that could cause this?
>
> Do you remember what kernel version quota worked correctly?
>
> Thanks,
> Satoru
>
>>
>> -Kevin Brandstatter
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-btrfs" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Quota Ignored On write

2014-07-03 Thread Satoru Takeuchi

Hi Kevin,

(2014/07/04 11:13), Kevin Brandstatter wrote:

basing of the latest for-linus branch i found i can write way more than
the quota

btrfs quota enable
btrfs subvolume create test
btrfs qgruop limit 1G test
dd if=/dev/zero of=test/file bs=1024 count=150
output:
150+0 records in
150+0 records out
153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s

thats a full half gig over the quota limit. I noticed some changes to
the quota
accounting in the logs, what changed that could cause this?


Do you remember what kernel version quota worked correctly?

Thanks,
Satoru



-Kevin Brandstatter
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Quota Ignored On write

2014-07-03 Thread Kevin Brandstatter
basing of the latest for-linus branch i found i can write way more than
the quota

btrfs quota enable
btrfs subvolume create test
btrfs qgruop limit 1G test
dd if=/dev/zero of=test/file bs=1024 count=150
output:
150+0 records in
150+0 records out
153600 bytes (1.5 GB) copied, 5.91909 s, 259 MB/s

thats a full half gig over the quota limit. I noticed some changes to
the quota
accounting in the logs, what changed that could cause this?

-Kevin Brandstatter
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html