Skip to contentSkip to conversation

Cannot create subvolume with quota enabled

DISCUSSION Andreas Philipp 4 participants 9 messages Sep 7, 2012 – Sep 11, 2012 Btrfs file system

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
master.

thor ~ # mkfs.btrfs -L test /dev/vg1/test

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label test on /dev/vg1/test

        nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB

Btrfs Btrfs v0.19
thor ~ # mount /dev/vg1/test /mnt/tmp
thor ~ # btrfs quota enable /mnt/tmp
thor ~ # btrfs subvolume create /mnt/tmp/test
Create subvolume '/mnt/tmp/test'
ERROR: cannot create subvolume - Invalid argument

Please, do not hesitate to contact me for any further information etc.

Thanks,
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQSky/AAoJEIW3W1BiBxU7/AIH/0K+FRSFl619SKnSrpiib+wk 5Rf+R9mjMn9yateRbhtblBF5KuWfGELO8w7okf6Mg6L/wCD7fYFuwo8Gwm7RvG/T lBrOCRPvrdkT78+elX/Jaj1QKWcYkTz7bkpcXf57zdzLruO1VwF0aCQZOFDR/qD2 d3oI5OCc/3Qw9G0ZnqV/z+bT3oqJRPJBV4ihB1SSI+5YpCAtHBW1jFGfwWRuA+ZV Q+iPPjMKZALG6wQYu+4WG5M1l9pC9y/aRetBfWplQTVgfT4Hh3eZjvq6OnDv9ZiO rWLSTqG0uBRCW2Sws0uFpPKMod0RFWm0sJNfkzGAM6O3a15CGTPnA9Hq0SgMRL4= =pr3t
-----END PGP SIGNATURE-----

#1 lore raw

Hi Andreas,

Quoted 8 lines · Andreas Philipp

Hi,

The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

master.

Quoted 11 lines

thor ~ # mkfs.btrfs -L test /dev/vg1/test

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see
http://btrfs.wiki.kernel.org before using

fs created label test on /dev/vg1/test nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB Btrfs Btrfs v0.19 thor ~ # mount /dev/vg1/test /mnt/tmp thor ~ # btrfs quota enable /mnt/tmp thor ~

# btrfs subvolume create /mnt/tmp/test Create subvolume
'/mnt/tmp/test' ERROR: cannot create subvolume - Invalid argument

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

Thanks,
Arne

Quoted 9 lines

Please, do not hesitate to contact me for any further information etc.

Thanks, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi Arne,

Quoted 22 lines · Arne Jansen

Hi Andreas,

Quoted 8 lines · Andreas Philipp

Hi,

The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

master.

Quoted 10 lines

thor ~ # mkfs.btrfs -L test /dev/vg1/test

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see
http://btrfs.wiki.kernel.org before using

fs created label test on /dev/vg1/test nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB Btrfs Btrfs v0.19 thor ~ # mount /dev/vg1/test /mnt/tmp thor ~ # btrfs quota enable /mnt/tmp thor ~

# btrfs subvolume create /mnt/tmp/test Create subvolume
'/mnt/tmp/test' ERROR: cannot create subvolume - Invalid argument
Quoted 6 lines

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

With the patch applied (on top of either 3.6-rc4 or 3.6-rc5) I can create subvolumes as you see below.

root@debian:~# mkfs.btrfs /dev/sdb

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label (null) on /dev/sdb

        nodesize 4096 leafsize 4096 sectorsize 4096 size 3.00GB
Btrfs Btrfs v0.19
root@debian:~# mount /dev/sdb /mnt/test
root@debian:~# btrfs quota enable /mnt/test
root@debian:~# btrfs subvolume create /mnt/test/subvolume
Create subvolume '/mnt/test/subvolume'
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# dd if=/dev/urandom of=/mnt/test/subvolume/testfile
bs=1024k count=25
25+0 records in
25+0 records out
26214400 bytes (26 MB) copied, 2.95321 s, 8.9 MB/s
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# du -hs /mnt/test/*
25M     /mnt/test/subvolume

At least I expected that the output of ' btrfs qgroup show' changes after some data got written to a subvolume which is assigned to a qgroup. (Hope, I got it right.)

Thanks,
Andreas

Quoted 11 lines

Thanks,
Arne

Quoted 8 lines

Please, do not hesitate to contact me for any further information etc.

Thanks, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 58 lines · Andreas Philipp

Hi Arne,

Quoted 22 lines · Arne Jansen

Hi Andreas,

Quoted 8 lines · Andreas Philipp

Hi,

The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

master.

Quoted 10 lines

thor ~ # mkfs.btrfs -L test /dev/vg1/test

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see
http://btrfs.wiki.kernel.org before using

fs created label test on /dev/vg1/test nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB Btrfs Btrfs v0.19 thor ~ # mount /dev/vg1/test /mnt/tmp thor ~ # btrfs quota enable /mnt/tmp thor ~

# btrfs subvolume create /mnt/tmp/test Create subvolume
'/mnt/tmp/test' ERROR: cannot create subvolume - Invalid argument
Quoted 6 lines

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

With the patch applied (on top of either 3.6-rc4 or 3.6-rc5) I can create subvolumes as you see below.

root@debian:~# mkfs.btrfs /dev/sdb

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label (null) on /dev/sdb

        nodesize 4096 leafsize 4096 sectorsize 4096 size 3.00GB
Btrfs Btrfs v0.19
root@debian:~# mount /dev/sdb /mnt/test
root@debian:~# btrfs quota enable /mnt/test
root@debian:~# btrfs subvolume create /mnt/test/subvolume
Create subvolume '/mnt/test/subvolume'
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# dd if=/dev/urandom of=/mnt/test/subvolume/testfile
bs=1024k count=25
25+0 records in
25+0 records out
26214400 bytes (26 MB) copied, 2.95321 s, 8.9 MB/s
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# du -hs /mnt/test/*
25M     /mnt/test/subvolume
Quoted 3 lines

At least I expected that the output of ' btrfs qgroup show' changes after some data got written to a subvolume which is assigned to a qgroup. (Hope, I got it right.)

due to delayed-*, the accounting also sometimes shows up delayed. After a sync you should see the changes.

Quoted 21 lines

Thanks,
Andreas

Quoted 11 lines

Thanks,
Arne

Quoted 8 lines

Please, do not hesitate to contact me for any further information etc.

Thanks, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

2012/9/10 Arne Jansen <[email protected]>:

Quoted 59 lines · Andreas Philipp
Quoted 58 lines

Hi Arne,

Quoted 22 lines · Arne Jansen

Hi Andreas,

Quoted 8 lines · Andreas Philipp

Hi,

The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

master.

Quoted 10 lines

thor ~ # mkfs.btrfs -L test /dev/vg1/test

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see
http://btrfs.wiki.kernel.org before using

fs created label test on /dev/vg1/test nodesize 4096 leafsize 4096 sectorsize 4096 size 20.00GB Btrfs Btrfs v0.19 thor ~ # mount /dev/vg1/test /mnt/tmp thor ~ # btrfs quota enable /mnt/tmp thor ~

# btrfs subvolume create /mnt/tmp/test Create subvolume
'/mnt/tmp/test' ERROR: cannot create subvolume - Invalid argument
Quoted 6 lines

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

With the patch applied (on top of either 3.6-rc4 or 3.6-rc5) I can create subvolumes as you see below.

root@debian:~# mkfs.btrfs /dev/sdb

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label (null) on /dev/sdb

        nodesize 4096 leafsize 4096 sectorsize 4096 size 3.00GB
Btrfs Btrfs v0.19
root@debian:~# mount /dev/sdb /mnt/test
root@debian:~# btrfs quota enable /mnt/test
root@debian:~# btrfs subvolume create /mnt/test/subvolume
Create subvolume '/mnt/test/subvolume'
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# dd if=/dev/urandom of=/mnt/test/subvolume/testfile
bs=1024k count=25
25+0 records in
25+0 records out
26214400 bytes (26 MB) copied, 2.95321 s, 8.9 MB/s
root@debian:~# btrfs qgroup show /mnt/test
0/257 4096 4096
root@debian:~# du -hs /mnt/test/*
25M     /mnt/test/subvolume
Quoted 6 lines
Quoted 3 lines

At least I expected that the output of ' btrfs qgroup show' changes after some data got written to a subvolume which is assigned to a qgroup. (Hope, I got it right.)

due to delayed-*, the accounting also sometimes shows up delayed. After a sync you should see the changes.

Sorry, I forgot to check with umount & mount or sync. It works.

Thanks,
Andreas

Quoted 23 lines
Quoted 22 lines

Thanks,
Andreas

Quoted 11 lines

Thanks,
Arne

Quoted 8 lines

Please, do not hesitate to contact me for any further information etc.

Thanks, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Arne Jansen
Quoted 9 lines · Arne Jansen

Hi Andreas,

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

Even with this patch I still have a similar problem: When I try to create a snapshot of an old subvolume that was created before I enabled quotas, it fails. For new subvolumes it works just fine. Here's an example ouput:

virtual ~ # btrfs sub snap /mnt/butter/old /mnt/butter/old-snap Create a snapshot of '/mnt/butter/old' in '/mnt/butter/old-snap'
ERROR: cannot snapshot '/mnt/butter/old' - Invalid argument

#6 lore raw
Quoted 11 lines · Marios Titas
Quoted 9 lines · Arne Jansen

Hi Andreas,

Thanks for giving quota a try. I sent a fix separately with the subject

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

Could you please see if it fixes the problem?

Quoted 8 lines

Even with this patch I still have a similar problem: When I try to create a snapshot of an old subvolume that was created before I enabled quotas, it fails. For new subvolumes it works just fine. Here's an example ouput:

virtual ~ # btrfs sub snap /mnt/butter/old /mnt/butter/old-snap Create a snapshot of '/mnt/butter/old' in '/mnt/butter/old-snap'
ERROR: cannot snapshot '/mnt/butter/old' - Invalid argument

instead of applying my patch, could you please just revert

commit 5986802c2fcc754040bb7ed95f30bb16c4a843b7

Author: Dan Carpenter <[email protected]>
Date:   Mon Jul 30 02:16:10 2012 -0600

Btrfs: fix some error codes in btrfs_qgroup_inherit()

It introduces both faulty return codes.

Thanks,
Arne

#7 lore raw
Quoted 10 lines · Arne Jansen

instead of applying my patch, could you please just revert

commit 5986802c2fcc754040bb7ed95f30bb16c4a843b7

Author: Dan Carpenter <[email protected]>
Date:   Mon Jul 30 02:16:10 2012 -0600

Btrfs: fix some error codes in btrfs_qgroup_inherit()

It introduces both faulty return codes.

Yes, reverting 5986802 and completely ignoring your earlier patch works.

#8 lore raw
Quoted 8 lines · Marios Titas
Quoted 7 lines · Arne Jansen

instead of applying my patch, could you please just revert

commit 5986802c2fcc754040bb7ed95f30bb16c4a843b7

Author: Dan Carpenter <[email protected]>
Date:   Mon Jul 30 02:16:10 2012 -0600
Quoted 6 lines
Quoted 3 lines

Btrfs: fix some error codes in btrfs_qgroup_inherit()

It introduces both faulty return codes.

Yes, reverting 5986802 and completely ignoring your earlier patch works.

Sorry for that.

Arne, you reviewed the patch when I sent it originally right? You were in the To: field and your btrfs_qgroup_inherit() code had just hit linux-next the day before.

regards,
dan carpenter