Aborting unused transaction

2015-09-02 Thread Stefan Priebe - Profihost AG
Hi, [447062.309251] Modules linked in: dm_mod netconsole ipt_REJECT nf_reject_ipv4 xt_multiport iptable_filter ip_tables x_tables cpufreq_userspace cpufreq_stats cpufreq_powersave cpufreq_conservative bonding ext2 usbhid coretemp loop ehci_pci sb_edac ehci_hcd edac_core i2c_i801 i2c_core usbcore s

Re: How to properly and efficiently balance RAID6 after more drives are added?

2015-09-02 Thread Duncan
Christian Rohmann posted on Wed, 02 Sep 2015 15:09:47 +0200 as excerpted: > Hey Hugo, > > thanks for the quick response. > > On 09/02/2015 01:30 PM, Hugo Mills wrote: >> You had some data on the first 8 drives with 6 data+2 parity, then >> added four more. From that point on, you were adding blo

[PATCH v2] btrfs: qgroup: exit the rescan worker during umount

2015-09-02 Thread Justin Maggard
v2: Fix stupid error while making formatting changes... I was hitting a consistent NULL pointer dereference during shutdown that showed the trace running through end_workqueue_bio(). I traced it back to the endio_meta_workers workqueue being poked after it had already been destroyed. Eventually

[PATCH] btrfs: qgroup: exit the rescan worker during umount

2015-09-02 Thread Justin Maggard
I was hitting a consistent NULL pointer dereference during shutdown that showed the trace running through end_workqueue_bio(). I traced it back to the endio_meta_workers workqueue being poked after it had already been destroyed. Eventually I found that the root cause was a qgroup rescan that was

Re: [PATCH] btrfs-progs: doc: document btrfs-select-super(8)

2015-09-02 Thread David Sterba
On Wed, Sep 02, 2015 at 05:00:46AM +0200, Adam Borowski wrote: > Signed-off-by: Adam Borowski Applied, thanks. -- 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-i

Re: [PATCH 5/6] Btrfs: wire up the free space tree to the extent tree

2015-09-02 Thread Josef Bacik
On 09/02/2015 12:42 AM, Omar Sandoval wrote: On Tue, Sep 01, 2015 at 03:48:57PM -0400, Josef Bacik wrote: On 09/01/2015 03:05 PM, Omar Sandoval wrote: From: Omar Sandoval The free space tree is updated in tandem with the extent tree. There are only a handful of places where we need to hook in

Re: [PATCH 1/3] btrfs-progs: use calloc instead of malloc+memset for tree roots

2015-09-02 Thread David Sterba
On Tue, Sep 01, 2015 at 12:22:44PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Signed-off-by: Omar Sandoval I'll apply that one now as it's independent on the feature. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord.

Re: [PATCH v3 0/4] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread David Sterba
On Wed, Sep 02, 2015 at 08:22:28PM +0800, Zhao Lei wrote: > chunk-recover need to use many many time in scan_devices(), > and no output in screen: > # btrfs rescue chunk-recover /dev/sda6 > (no output here, but need long time) > > To notice user that "the command is not hang", this patch add > d

Re: How to properly and efficiently balance RAID6 after more drives are added?

2015-09-02 Thread Christian Rohmann
Hey Hugo, thanks for the quick response. On 09/02/2015 01:30 PM, Hugo Mills wrote: > You had some data on the first 8 drives with 6 data+2 parity, then > added four more. From that point on, you were adding block groups > with 10 data+2 parity. At some point, the first 8 drives became > full, an

[PATCH v3 2/4] btrfs-progs: Use long type to get thread's return value

2015-09-02 Thread Zhao Lei
pthread use void * to save return status, we can use this pointer to save our return value, but we need keep the same length. This patch move to use long type variable to save return value of our thread, to avoid potentia invalid memory access. Signed-off-by: Zhao Lei --- chunk-recover.c | 4 ++

[PATCH v3 4/4] btrfs-progs: Fix some spelling typo in chunk-recover.c

2015-09-02 Thread Zhao Lei
Only comment, not big issue. And remove no-use aggument in block_group_free_all_extent(). Signed-off-by: Zhao Lei --- chunk-recover.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 562817b..962a72b 100644 --- a/chunk-recover.

[PATCH v3 0/4] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH v3 3/4] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH v3 1/4] btrfs-progs: use for loop for scan_devices

2015-09-02 Thread Zhao Lei
for() is more suitable than while() in this code block. Signed-off-by: Zhao Lei --- chunk-recover.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 832b3b1..66a4ce6 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -871,8 +871,7

Re: How to properly and efficiently balance RAID6 after more drives are added?

2015-09-02 Thread Hugo Mills
On Wed, Sep 02, 2015 at 12:29:06PM +0200, Christian Rohmann wrote: > Hello btrfs-enthusiasts, > > I have a rather big btrfs RAID6 with currently 12 devices. It used to be > only 8 drives 4TB each, but I successfully added 4 more drives with 1TB > each at some point. What I am trying to find out, a

How to properly and efficiently balance RAID6 after more drives are added?

2015-09-02 Thread Christian Rohmann
Hello btrfs-enthusiasts, I have a rather big btrfs RAID6 with currently 12 devices. It used to be only 8 drives 4TB each, but I successfully added 4 more drives with 1TB each at some point. What I am trying to find out, and that's my main reason for posting this, is how to balance the data on the

[PATCH v2 3/3] btrfs-progs: Fix some spelling typo in chunk-recover.c

2015-09-02 Thread Zhao Lei
Only comment, not big issue. And remove no-use aggument in block_group_free_all_extent(). Signed-off-by: Zhao Lei --- chunk-recover.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 7698ee0..1d8fe81 100644 --- a/chunk-recover.

[PATCH v2 1/3] btrfs-progs: use for loop for scan_devices

2015-09-02 Thread Zhao Lei
for() is more suitable than while() in this code block. Signed-off-by: Zhao Lei --- chunk-recover.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 832b3b1..66a4ce6 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -871,8 +871,7

[PATCH v2 2/3] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH v2 0/3] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH 1/3] btrfs-progs: use for loop for scan_devices

2015-09-02 Thread Zhao Lei
for() is more suitable than while() in this code block. Signed-off-by: Zhao Lei --- chunk-recover.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 832b3b1..66a4ce6 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -871,8 +871,7

[PATCH 3/3] btrfs-progs: Fix some spelling typo in chunk-recover.c

2015-09-02 Thread Zhao Lei
Only comment, not big issue. And remove no-use aggument in block_group_free_all_extent(). Signed-off-by: Zhao Lei --- chunk-recover.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 7698ee0..d9d777a 100644 --- a/chunk-recover.c +++

[PATCH 2/3] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH 0/3] btrfs-progs: stat info for btrfs rescue chunk-recover

2015-09-02 Thread Zhao Lei
chunk-recover need to use many many time in scan_devices(), and no output in screen: # btrfs rescue chunk-recover /dev/sda6 (no output here, but need long time) To notice user that "the command is not hang", this patch add dynamic updated stat information in above period: # btrfs rescue chunk-r

[PATCH RFC 13/14] btrfs: extent-tree: Add new verions of btrfs_check_data_free_space

2015-09-02 Thread Qu Wenruo
Add new function __btrfs_check_data_free_space() to do precious space reservation. The new function will replace old btrfs_check_data_free_space(), but until all the change is done, let's just use the new name. Also, export internal use function btrfs_alloc_data_chunk_ondemand(), as now qgroup re

[PATCH RFC 01/14] btrfs: qgroup: New function declaration for new reserve implement

2015-09-02 Thread Qu Wenruo
Add new structures and functions for new qgroup reserve implement dirty phase. Which will focus on avoiding over-reserve as in that case, which means for already reserved dirty space range, we won't reserve space again. This patch adds the needed structure declaration and comments. Signed-off-by:

[PATCH RFC 10/14] btrfs: delayed_ref: release and free qgroup reserved at proper timing

2015-09-02 Thread Qu Wenruo
Qgroup reserved space needs to be released from inode dirty map and get freed at different timing: 1) Release when the metadata is written into tree After corresponding metadata is written into tree, any newer write will be COWed(don't include NOCOW case yet). So we must release its range from ino

[PATCH RFC 08/14] btrfs: qgroup: Introduce function to release/free reserved data range

2015-09-02 Thread Qu Wenruo
Introduce functions btrfs_qgroup_release/free_data() to release/free reserved data range. Release means, just remove the data range from data rsv map, but doesn't free the reserved space. Free means not only remove data range, but also free reserved space. Signed-off-by: Qu Wenruo --- fs/btrfs/

[PATCH RFC 10/14] btrfs: delayed_ref: release and free qgroup reserved at proper timing

2015-09-02 Thread Qu Wenruo
Qgroup reserved space needs to be released from inode dirty map and get freed at different timing: 1) Release when the metadata is written into tree After corresponding metadata is written into tree, any newer write will be COWed(don't include NOCOW case yet). So we must release its range from ino

[PATCH RFC 07/14] btrfs: qgroup: Introduce function to release reserved range

2015-09-02 Thread Qu Wenruo
Introduce new function release_data_range() to release reserved ranges. It will iterate through all existing ranges and remove/shrink them. Note this function will not free reserved space, as the range can be released in the following conditions: 1) The dirty range gets written to disk. In this

[PATCH RFC 02/14] btrfs: qgroup: Implement data_rsv_map init/free functions

2015-09-02 Thread Qu Wenruo
New functions btrfs_qgroup_init/free_data_rsv_map() to init/free data reserve map. Data reserve map is used to mark which range already holds reserved space, to avoid current reserved space leak. Signed-off-by: Qu Wenruo --- fs/btrfs/btrfs_inode.h | 2 ++ fs/btrfs/inode.c | 10 +++ f

[PATCH RFC 05/14] btrfs: qgroup: Introduce function to reserve data range per inode

2015-09-02 Thread Qu Wenruo
Introduce new function reserve_data_range(). This function will find non-overlap range and to insert it into reserve map using previously introduced funtions. This provides the basis for later per inode reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 92 +

[PATCH RFC 02/14] btrfs: qgroup: Implement data_rsv_map init/free functions

2015-09-02 Thread Qu Wenruo
New functions btrfs_qgroup_init/free_data_rsv_map() to init/free data reserve map. Data reserve map is used to mark which range already holds reserved space, to avoid current reserved space leak. Signed-off-by: Qu Wenruo --- fs/btrfs/btrfs_inode.h | 2 ++ fs/btrfs/inode.c | 10 +++ f

[PATCH RFC 08/14] btrfs: qgroup: Introduce function to release/free reserved data range

2015-09-02 Thread Qu Wenruo
Introduce functions btrfs_qgroup_release/free_data() to release/free reserved data range. Release means, just remove the data range from data rsv map, but doesn't free the reserved space. Free means not only remove data range, but also free reserved space. Signed-off-by: Qu Wenruo --- fs/btrfs/

[PATCH RFC 13/14] btrfs: extent-tree: Add new verions of btrfs_check_data_free_space

2015-09-02 Thread Qu Wenruo
Add new function __btrfs_check_data_free_space() to do precious space reservation. The new function will replace old btrfs_check_data_free_space(), but until all the change is done, let's just use the new name. Also, export internal use function btrfs_alloc_data_chunk_ondemand(), as now qgroup re

[PATCH RFC 03/14] btrfs: qgroup: Introduce new function to search most left reserve range

2015-09-02 Thread Qu Wenruo
Introduce the new function to search the most left reserve range in a reserve map. It provides the basis for later reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 36 1 file changed, 36 insertions(+) diff --git a/fs/btrfs/qgroup.c b/

[PATCH RFC 14/14] btrfs: Use new check_data_free_space for buffered write

2015-09-02 Thread Qu Wenruo
Use new check_data_free_space for buffered write. Because nodatacow write won't increase quota account, so unlike only behavior which does reserve before check nocow, here we check nocow first and then only reserve data if we can't do nocow write. Signed-off-by: Qu Wenruo --- fs/btrfs/file.c |

[PATCH RFC 12/14] btrfs: qgroup: Use new metadata reservation.

2015-09-02 Thread Qu Wenruo
As we have the new metadata reservation functions, use them to replace the old btrfs_qgroup_reserve() call for metadata. Signed-off-by: Qu Wenruo --- fs/btrfs/extent-tree.c | 14 ++ fs/btrfs/transaction.c | 15 ++- 2 files changed, 12 insertions(+), 17 deletions(-) diff

[PATCH RFC 11/14] btrfs: qgroup: Introduce new functions to reserve/free metadata

2015-09-02 Thread Qu Wenruo
Introduce new functions btrfs_qgroup_reserve/free_meta() to reserve/free metadata reserved space. Signed-off-by: Qu Wenruo --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/disk-io.c | 1 + fs/btrfs/qgroup.c | 40 fs/btrfs/qgroup.h | 4 4 files changed,

[PATCH RFC 00/14] Qgroup reserved space fixing framework

2015-09-02 Thread Qu Wenruo
!!WARNING START!! These patch is just a WIP patchset, although it fixed a qgroup reserved space leaking bug in normal COW case, it still lacks fix for other corner case, like NODATACOW or prealloc case. And may still cause reserved space to overflow to minus. The reason to send the WIP pat

[PATCH RFC 06/14] btrfs: qgroup: Introduce btrfs_qgroup_reserve_data function

2015-09-02 Thread Qu Wenruo
This new function will do all the hard work to reserve precious space for a write. The overall work flow will be the following. File A already has some dirty pages: 0 4K 8K 12K 16K |///| |///| And then, someone want to write some data into range [4K, 16K).

[PATCH RFC 05/14] btrfs: qgroup: Introduce function to reserve data range per inode

2015-09-02 Thread Qu Wenruo
Introduce new function reserve_data_range(). This function will find non-overlap range and to insert it into reserve map using previously introduced funtions. This provides the basis for later per inode reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 92 +

[PATCH RFC 14/14] btrfs: Use new check_data_free_space for buffered write

2015-09-02 Thread Qu Wenruo
Use new check_data_free_space for buffered write. Because nodatacow write won't increase quota account, so unlike only behavior which does reserve before check nocow, here we check nocow first and then only reserve data if we can't do nocow write. Signed-off-by: Qu Wenruo --- fs/btrfs/file.c |

[PATCH RFC 06/14] btrfs: qgroup: Introduce btrfs_qgroup_reserve_data function

2015-09-02 Thread Qu Wenruo
This new function will do all the hard work to reserve precious space for a write. The overall work flow will be the following. File A already has some dirty pages: 0 4K 8K 12K 16K |///| |///| And then, someone want to write some data into range [4K, 16K).

[PATCH RFC 04/14] btrfs: qgroup: Introduce function to insert non-overlap reserve range

2015-09-02 Thread Qu Wenruo
New function insert_data_ranges() will insert non-overlap reserve ranges into reserve map. It provides the basis for later qgroup reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 123 ++ 1 file changed, 123 insertions(+)

[PATCH RFC 09/14] btrfs: delayed_ref: Add new function to record reserved space into delayed ref

2015-09-02 Thread Qu Wenruo
Add new function btrfs_add_delayed_qgroup_reserve() function to record how much space is reserved for that extent. As btrfs only accounts qgroup at run_delayed_refs() time, so newly allocated extent should keep the reserved space until then. So add needed function with related members to do it.

[PATCH RFC 04/14] btrfs: qgroup: Introduce function to insert non-overlap reserve range

2015-09-02 Thread Qu Wenruo
New function insert_data_ranges() will insert non-overlap reserve ranges into reserve map. It provides the basis for later qgroup reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 123 ++ 1 file changed, 123 insertions(+)

[PATCH RFC 03/14] btrfs: qgroup: Introduce new function to search most left reserve range

2015-09-02 Thread Qu Wenruo
Introduce the new function to search the most left reserve range in a reserve map. It provides the basis for later reserve map implement. Signed-off-by: Qu Wenruo --- fs/btrfs/qgroup.c | 36 1 file changed, 36 insertions(+) diff --git a/fs/btrfs/qgroup.c b/

[PATCH RFC 07/14] btrfs: qgroup: Introduce function to release reserved range

2015-09-02 Thread Qu Wenruo
Introduce new function release_data_range() to release reserved ranges. It will iterate through all existing ranges and remove/shrink them. Note this function will not free reserved space, as the range can be released in the following conditions: 1) The dirty range gets written to disk. In this

[PATCH 15/15] btrfs: fallocate: Add support to accurate qgroup reserve

2015-09-02 Thread Qu Wenruo
Now fallocate will do accurate qgroup reserve space check, unlike old method, which will always reserve the whole length of the range. With this patch, fallocate will: 1) Iterate the desired range and mark in data rsv map Only range which is going to be allocated will be recorded in data rsv

[PATCH RFC 12/14] btrfs: qgroup: Use new metadata reservation.

2015-09-02 Thread Qu Wenruo
As we have the new metadata reservation functions, use them to replace the old btrfs_qgroup_reserve() call for metadata. Signed-off-by: Qu Wenruo --- fs/btrfs/extent-tree.c | 14 ++ fs/btrfs/transaction.c | 15 ++- 2 files changed, 12 insertions(+), 17 deletions(-) diff

[PATCH 15/15] btrfs: fallocate: Add support to accurate qgroup reserve

2015-09-02 Thread Qu Wenruo
Now fallocate will do accurate qgroup reserve space check, unlike old method, which will always reserve the whole length of the range. With this patch, fallocate will: 1) Iterate the desired range and mark in data rsv map Only range which is going to be allocated will be recorded in data rsv

[PATCH RFC 01/14] btrfs: qgroup: New function declaration for new reserve implement

2015-09-02 Thread Qu Wenruo
Add new structures and functions for new qgroup reserve implement dirty phase. Which will focus on avoiding over-reserve as in that case, which means for already reserved dirty space range, we won't reserve space again. This patch adds the needed structure declaration and comments. Signed-off-by:

[PATCH RFC 11/14] btrfs: qgroup: Introduce new functions to reserve/free metadata

2015-09-02 Thread Qu Wenruo
Introduce new functions btrfs_qgroup_reserve/free_meta() to reserve/free metadata reserved space. Signed-off-by: Qu Wenruo --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/disk-io.c | 1 + fs/btrfs/qgroup.c | 40 fs/btrfs/qgroup.h | 4 4 files changed,

[PATCH RFC 09/14] btrfs: delayed_ref: Add new function to record reserved space into delayed ref

2015-09-02 Thread Qu Wenruo
Add new function btrfs_add_delayed_qgroup_reserve() function to record how much space is reserved for that extent. As btrfs only accounts qgroup at run_delayed_refs() time, so newly allocated extent should keep the reserved space until then. So add needed function with related members to do it.

[PATCH RFC 00/14] Qgroup reserved space fixing framework

2015-09-02 Thread Qu Wenruo
!!WARNING START!! These patch is just a WIP patchset, although it fixed a qgroup reserved space leaking bug in normal COW case, it still lacks fix for other corner case, like NODATACOW or prealloc case. And may still cause reserved space to overflow to minus. The reason to send the WIP pat

[PATCH] btrfs: fix a compiler warning of may be used uninitialized

2015-09-02 Thread Zhao Lei
Not real problem, just avoid warning of: fs/btrfs/inode-map.c: In function 'btrfs_unpin_free_ino': fs/btrfs/inode-map.c:252: warning: 'count' may be used uninitialized in this function In gcc 4.8.3 Signed-off-by: Zhao Lei --- fs/btrfs/inode-map.c | 2 +- 1 file changed, 1 insertion(+), 1 dele