Warnings on file removal after Quota exceeded error (EDQUOT)

2013-01-24 Thread Lev Vainblat

Hi all,

I executed the following simple sequence of commands:

# mount /dev/sda /mnt/btrfs
# btrfs quota enable /mnt/btrfs/
# btrfs subvolume create /mnt/btrfs/SV
Create subvolume '/mnt/btrfs/SV'
# btrfs qgroup limit 1m /mnt/btrfs/SV
# dd if=/dev/zero of=/mnt/btrfs/SV/file bs=64x1024
dd: writing `/mnt/btrfs/SV/file': Disk quota exceeded
16+0 records in
15+0 records out
983040 bytes (983 kB) copied, 0.00192474 s, 511 MB/s
# rm /mnt/btrfs/SV/file

The file was removed, but in the kern.log I see:

[67577.594688] [ cut here ]
[67577.594723] WARNING: at /source/fs/btrfs/inode.c:7177 
btrfs_destroy_inode+0x266/0x300 [btrfs]()

[67577.594726] Hardware name: Bochs
[67577.594728] Modules linked in: btrfs(O) libcrc32c deflate zlib_deflate 
ctr twofish_generic twofish_x86_64_3way glue_helper lrw xts gf128mul 
twofish_x86_64 twofish_common camellia_generic serpent_generic 
blowfish_generic blowfish_x86_64 blowfish_common cast5_generic des_generic 
xcbc rmd160 sha512_generic crypto_null af_key xfrm_algo kvm ppdev microcode 
psmouse nfsv4 serio_raw nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc 
parport_pc mac_hid i2c_piix4 lp parport floppy [last unloaded: btrfs]
[67577.594788] Pid: 10692, comm: rm Tainted: GW  O 3.7.0-560-generic 
#57ba86c00f9573b63b8c06810d4f6915efed2442

[67577.594790] Call Trace:
[67577.594804]  [] warn_slowpath_common+0x7f/0xc0
[67577.594810]  [] warn_slowpath_null+0x1a/0x20
[67577.594830]  [] btrfs_destroy_inode+0x266/0x300 [btrfs]
[67577.594838]  [] destroy_inode+0x3c/0x70
[67577.594843]  [] evict+0x136/0x1d0
[67577.594849]  [] iput_final+0xe2/0x170
[67577.594853]  [] iput+0x3e/0x50
[67577.594859]  [] do_unlinkat+0x12b/0x1d0
[67577.594867]  [] ? do_page_fault+0xe/0x10
[67577.594871]  [] ? do_async_page_fault+0x35/0xa0
[67577.594877]  [] sys_unlinkat+0x22/0x40
[67577.594883]  [] system_call_fastpath+0x16/0x1b
[67577.594886] ---[ end trace 0b7f0b925e0b6048 ]---
[67577.594888] [ cut here ]
[67577.594906] WARNING: at /source/fs/btrfs/inode.c:7178 
btrfs_destroy_inode+0x2ef/0x300 [btrfs]()

[67577.594908] Hardware name: Bochs
[67577.594910] Modules linked in: btrfs(O) libcrc32c deflate zlib_deflate 
ctr twofish_generic twofish_x86_64_3way glue_helper lrw xts gf128mul 
twofish_x86_64 twofish_common camellia_generic serpent_generic 
blowfish_generic blowfish_x86_64 blowfish_common cast5_generic des_generic 
xcbc rmd160 sha512_generic crypto_null af_key xfrm_algo kvm ppdev microcode 
psmouse nfsv4 serio_raw nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc 
parport_pc mac_hid i2c_piix4 lp parport floppy [last unloaded: btrfs]
[67577.594979] Pid: 10692, comm: rm Tainted: GW  O 3.7.0-560-generic 
#57ba86c00f9573b63b8c06810d4f6915efed2442

[67577.594981] Call Trace:
[67577.594988]  [] warn_slowpath_common+0x7f/0xc0
[67577.594993]  [] warn_slowpath_null+0x1a/0x20
[67577.595012]  [] btrfs_destroy_inode+0x2ef/0x300 [btrfs]
[67577.595017]  [] destroy_inode+0x3c/0x70
[67577.595022]  [] evict+0x136/0x1d0
[67577.595027]  [] iput_final+0xe2/0x170
[67577.595032]  [] iput+0x3e/0x50
[67577.595037]  [] do_unlinkat+0x12b/0x1d0
[67577.595042]  [] ? do_page_fault+0xe/0x10
[67577.595046]  [] ? do_async_page_fault+0x35/0xa0
[67577.595051]  [] sys_unlinkat+0x22/0x40
[67577.595056]  [] system_call_fastpath+0x16/0x1b
[67577.595059] ---[ end trace 0b7f0b925e0b6049 ]---

Then, when I delete the subvolume and unmount the file system I also get 
warnings:


# btrfs subvolume delete /mnt/btrfs/SV
Delete subvolume '/mnt/btrfs/SV'
# umount /mnt/btrfs

[67847.557519] [ cut here ]
[67847.557550] WARNING: at /source/fs/btrfs/extent-tree.c:4366 
btrfs_free_block_groups+0x2ce/0x370 [btrfs]()

[67847.557553] Hardware name: Bochs
[67847.557554] Modules linked in: btrfs(O) libcrc32c deflate zlib_deflate 
ctr twofish_generic twofish_x86_64_3way glue_helper lrw xts gf128mul 
twofish_x86_64 twofish_common camellia_generic serpent_generic 
blowfish_generic blowfish_x86_64 blowfish_common cast5_generic des_generic 
xcbc rmd160 sha512_generic crypto_null af_key xfrm_algo kvm ppdev microcode 
psmouse nfsv4 serio_raw nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc 
parport_pc mac_hid i2c_piix4 lp parport floppy [last unloaded: btrfs]
[67847.557614] Pid: 10706, comm: umount Tainted: GW  O 
3.7.0-560-generic #57ba86c00f9573b63b8c06810d4f6915efed2442

[67847.557616] Call Trace:
[67847.557629]  [] warn_slowpath_common+0x7f/0xc0
[67847.557635]  [] warn_slowpath_null+0x1a/0x20
[67847.557651]  [] btrfs_free_block_groups+0x2ce/0x370 
[btrfs]

[67847.557669]  [] close_ctree+0x1c7/0x310 [btrfs]
[67847.557678]  [] ? evict_inodes+0xce/0x130
[67847.557689]  [] btrfs_put_super+0x19/0x20 [btrfs]
[67847.557697]  [] generic_shutdown_super+0x62/0xf0
[67847.557703]  [] kill_anon_super+0x16/0x30
[67847.557714]  [] btrfs_kill_super+0x1a/0x90 [btrfs]
[67847.557720]  [] deactivate_locked_super+0x3c/0x90
[67847.557725]  [] deactivate_super+0x4e/0x70
[67847.557730]  [] mn

Re: Warnings on file removal after Quota exceeded error (EDQUOT)

2013-01-24 Thread Arne Jansen
On 24.01.2013 10:39, Lev Vainblat wrote:
> Hi all,
> 
> I executed the following simple sequence of commands:
> 
> # mount /dev/sda /mnt/btrfs
> # btrfs quota enable /mnt/btrfs/
> # btrfs subvolume create /mnt/btrfs/SV
> Create subvolume '/mnt/btrfs/SV'
> # btrfs qgroup limit 1m /mnt/btrfs/SV
> # dd if=/dev/zero of=/mnt/btrfs/SV/file bs=64x1024
> dd: writing `/mnt/btrfs/SV/file': Disk quota exceeded
> 16+0 records in
> 15+0 records out
> 983040 bytes (983 kB) copied, 0.00192474 s, 511 MB/s
> # rm /mnt/btrfs/SV/file
> 
> The file was removed, but in the kern.log I see:
> 

[snip]

> 
> Is this an expected behavior? Am I doing anything wrong here?

I can reproduce it here, will look into it. Thanks for reporting!

-Arne

> 
> Thanks,
> -Lev. 
> 
--
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: Warnings on file removal after Quota exceeded error (EDQUOT)

2013-01-28 Thread Jan Schmidt
Hi Lev,

On 24.01.2013 10:39, Lev Vainblat wrote:
> I executed the following simple sequence of commands:
> 
> # mount /dev/sda /mnt/btrfs
> # btrfs quota enable /mnt/btrfs/
> # btrfs subvolume create /mnt/btrfs/SV
> Create subvolume '/mnt/btrfs/SV'
> # btrfs qgroup limit 1m /mnt/btrfs/SV
> # dd if=/dev/zero of=/mnt/btrfs/SV/file bs=64x1024
> dd: writing `/mnt/btrfs/SV/file': Disk quota exceeded
> 16+0 records in
> 15+0 records out
> 983040 bytes (983 kB) copied, 0.00192474 s, 511 MB/s
> # rm /mnt/btrfs/SV/file

Thanks for the simple reproducer.

Although you probably have noticed through the cc, I should mention in
case someone digs this thread out of an archive: I sent a patch that
should fix your problem some hours ago, subject "Btrfs: fix EDQUOT
handling in btrfs_delalloc_reserve_metadata". Feel free to test and
report back :-)

-Jan
--
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