Re: [PATCH v2 2/2] Btrfs: compression must free at least PAGE_SIZE

2017-05-20 Thread Duncan
Timofey Titovets posted on Sat, 20 May 2017 21:30:47 +0300 as excerpted: > 2017-05-20 20:14 GMT+03:00 Kai Krakow : > >> BTW: What's the smallest block size that btrfs stores? Is it always >> PAGE_SIZE? I'm not familiar with btrfs internals... Thanks for asking the

Re: [PATCH 4/8] btrfs: autoremove qgroup by default, and add a mount flag to override

2017-05-20 Thread Sargun Dhillon
Just as a follow-up, folks are working around this in userspace: https://github.com/moby/moby/pull/29427 On Sat, May 20, 2017 at 1:39 AM, Sargun Dhillon wrote: > This change follows the change to automatically remove qgroups > if the associated subvolume has also been removed.

[PATCH v3 2/2] Btrfs: compression must free at least PAGE_SIZE

2017-05-20 Thread Timofey Titovets
Btrfs already skip store of data where compression didn't free at least one byte. So make logic better and make check that compression free at least one PAGE_SIZE, because in another case it useless to store this data compressed Signed-off-by: Timofey Titovets ---

[PATCH v3 0/2] Btrfs: compression fixes

2017-05-20 Thread Timofey Titovets
First patch: fix copy paste typo in debug message in lzo.c, lzo is not deflate Second patch: force btrfs to not store data as compressed, if compression will not free at least one PAGE_SIZE, because it's useless in term of storage and reading data from disk, as a result productivity suffers

[PATCH v3 1/2] Btrfs: lzo.c pr_debug() deflate->lzo

2017-05-20 Thread Timofey Titovets
Signed-off-by: Timofey Titovets --- fs/btrfs/lzo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index f48c8c14..bd0b0938 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -141,7 +141,7 @@ static int

Re: [PATCH v2 2/2] Btrfs: compression must free at least PAGE_SIZE

2017-05-20 Thread Timofey Titovets
2017-05-20 20:14 GMT+03:00 Kai Krakow : > Am Sat, 20 May 2017 19:49:53 +0300 > schrieb Timofey Titovets : > >> Btrfs already skip store of data where compression didn't free at >> least one byte. So make logic better and make check that compression >>

Re: [PATCH v2 2/2] Btrfs: compression must free at least PAGE_SIZE

2017-05-20 Thread Kai Krakow
Am Sat, 20 May 2017 19:49:53 +0300 schrieb Timofey Titovets : > Btrfs already skip store of data where compression didn't free at > least one byte. So make logic better and make check that compression > free at least one PAGE_SIZE, because in another case it useless to >

[PATCH v2 0/2] Btrfs: compression fixes

2017-05-20 Thread Timofey Titovets
First patch: fix copy paste typo in debug message in lzo.c, lzo is not deflate Second patch: force btrfs to not store data as compressed, if compression will not free at least one PAGE_SIZE, because it's useless in term of storage and reading data from disk, as a result productivity suffers

[PATCH v2 2/2] Btrfs: compression must free at least PAGE_SIZE

2017-05-20 Thread Timofey Titovets
Btrfs already skip store of data where compression didn't free at least one byte. So make logic better and make check that compression free at least one PAGE_SIZE, because in another case it useless to store this data compressed Signed-off-by: Timofey Titovets ---

[PATCH v2 1/2] Btrfs: lzo.c pr_debug() deflate->lzo

2017-05-20 Thread Timofey Titovets
Signed-off-by: Timofey Titovets --- fs/btrfs/lzo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index f48c8c14..bd0b0938 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -141,7 +141,7 @@ static int

Re: [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE

2017-05-20 Thread Timofey Titovets
2017-05-20 18:47 GMT+03:00 Lionel Bouton : > Le 19/05/2017 à 23:15, Timofey Titovets a écrit : >> 2017-05-19 23:19 GMT+03:00 Lionel Bouton >> : >>> I was too focused on other problems and having a fresh look at what I >>> wrote I'm

Re: [PATCH 2/3] Btrfs: lzo compression must free at least PAGE_SIZE

2017-05-20 Thread Lionel Bouton
Le 19/05/2017 à 23:15, Timofey Titovets a écrit : > 2017-05-19 23:19 GMT+03:00 Lionel Bouton > : >> I was too focused on other problems and having a fresh look at what I >> wrote I'm embarrassed by what I read. Used pages for a given amount >> of data should be

Re: Can't remount a BTRFS partition read write after a drive failure

2017-05-20 Thread Sylvain Leroux
On 05/19/2017 04:23 AM, Duncan wrote: > > What you seem to have missed is my earlier reply, saying, > effectively... > > Known issue. [...] Indeed I missed that reply. Sorry about that. Thank you Duncan for your reply, for the great explanations AND for having taken the time to repost it! > >

[PATCH 8/8] btrfs: Add new ioctl uapis for qgroup creation / removal

2017-05-20 Thread Sargun Dhillon
This patch ties together the work in the previous patches, to introduce semantics around the qgroup creation / removal API that are a bit more intuitive that the current one. It also creates two new args structures which have reserved space for future expansion, as opposed to single datastructure

[PATCH 6/8] btrfs: Add code to check if a qgroup's subvol exists

2017-05-20 Thread Sargun Dhillon
This patch is to prepare for following patches in this patchset. The purpose is to make it so that we can prevent accidental removal of qgroups that are actively in use. Signed-off-by: Sargun Dhillon --- fs/btrfs/ioctl.c | 4 ++-- fs/btrfs/qgroup.c | 50

[PATCH 7/8] btrfs: Add code to prevent qgroup creation for a non-existent subvol

2017-05-20 Thread Sargun Dhillon
This patch is to prepare for following patches in this patchset. The code allows you to check if a subvol exists, and to only allow the creation of qgroups on subvols that already exist. It doesn't make sense to allow the creation of level 0 qgroups otherwise. The behaviour is to inherit (create)

[PATCH 4/8] btrfs: autoremove qgroup by default, and add a mount flag to override

2017-05-20 Thread Sargun Dhillon
This change follows the change to automatically remove qgroups if the associated subvolume has also been removed. It changes the default behaviour to automatically remove qgroups when a subvolume is deleted, but this can be override with the qgroup_keep mount flag. Signed-off-by: Sargun Dhillon

[PATCH 5/8] btrfs: qgroup.h whitespace change

2017-05-20 Thread Sargun Dhillon
This patch is just changing whitespace alignment in qgroup.h Signed-off-by: Sargun Dhillon --- fs/btrfs/qgroup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h index fe04d3f..fb6c7da 100644 --- a/fs/btrfs/qgroup.h +++

[PATCH 1/8] btrfs: Split up btrfs_remove_qgroup, no logic changes

2017-05-20 Thread Sargun Dhillon
This change is purely a style change, so that btrfs_remove_qgroup is split. There is some whitespace changes, but this shouldn't have any effect on the logic of the code. Signed-off-by: Sargun Dhillon --- fs/btrfs/qgroup.c | 49 -

[PATCH 3/8] btrfs: Split up btrfs_create_qgroup, no logic changes

2017-05-20 Thread Sargun Dhillon
This change is purely a style change, so that btrfs_create_qgroup is split. There is some whitespace changes, but this shouldn't have any effect on the logic of the code. Signed-off-by: Sargun Dhillon --- fs/btrfs/qgroup.c | 32 1 file changed,

[PATCH 2/8] btrfs: Fail on removing qgroup if del_qgroup_item fails

2017-05-20 Thread Sargun Dhillon
Previously, we were calling del_qgroup_item, and ignoring the return code resulting in a potential to have divergent in-memory state without an error. Perhaps, it makes sense to handle this error code, and put the filesystem into a read only, or similar state. This patch only adds reporting of

[PATCH 0/8] BtrFS: QGroups uapi improvements

2017-05-20 Thread Sargun Dhillon
This patchset contains some improvements to qgroups. It changes the semantics around how qgroups are dealt with when subvolumes are deleted, and it also adds two new ioctls for qgroup deletion and addition. The new semantic around qgroup removal is that when the qgroup_nokeep mount flag is set,