[PATCH v3] btrfs: Use bd_dev to generate index when dev_state_hashtable add items.

2017-10-11 Thread Gu Jinxiang
From: Gu JinXiang Fix missing modify of commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t"). Function btrfsic_dev_state_hashtable_lookup use dev_t to generate hashval when lookup a btrfsic_dev_state in hash table. So when add a btrfsic_dev_state into

Re: [PATCH] Btrfs: free btrfs_device in place

2017-10-11 Thread Anand Jain
On 10/11/2017 05:51 AM, Liu Bo wrote: It's pointless to defer it to a kthread helper as we're not under any special context. Reviewed-by: Anand Jain Thanks, Anand Signed-off-by: Liu Bo --- fs/btrfs/volumes.c | 14 ++ 1 file

Re: [PATCH v2] Btrfs: avoid losing data raid profile when deleting a device

2017-10-11 Thread Nikolay Borisov
On 10.10.2017 20:53, Liu Bo wrote: > We've avoided data losing raid profile when doing balance, but it > turns out that deleting a device could also result in the same > problem > > This fixes the problem by creating an empty data chunk before > relocating the data chunk. Why is this needed -

Re: [PATCH] btrfs: fix max chunk size on dup

2017-10-11 Thread Naohiro Aota
Hi, You may notice my @wdc.com address is bounced. As my internship job at wdc is finished, the address is already expired. Please contact me on this @elisp.net address. 2017-10-11 2:42 GMT+09:00 Hans van Kranenburg : > Sorry for the mail spam, it's an interesting

Re: [PATCH v3] btrfs: Use bd_dev to generate index when dev_state_hashtable add items.

2017-10-11 Thread Nikolay Borisov
On 11.10.2017 11:44, Gu Jinxiang wrote: > From: Gu JinXiang > > Fix missing modify of > commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t"). > Function btrfsic_dev_state_hashtable_lookup use dev_t to generate hashval > when lookup a btrfsic_dev_state

Re: [PATCH] Remove unused dedupe argument btrfs_set_extent_delalloc()

2017-10-11 Thread Nikolay Borisov
On 11.10.2017 05:29, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > I had already sent similar patch and David said he is not removing the in-band dedup prep for now. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message

Re: [PATCH 1/5] blkcg: export blkcg_root_css

2017-10-11 Thread Jan Kara
On Tue 10-10-17 08:54:37, Tejun Heo wrote: > Export blkcg_root_css so that filesystem modules can use it. > > Signed-off-by: Tejun Heo Looks good. You can add: Reviewed-by: Jan Kara Honza > --- >

Re: [PATCH v2] btrfs: Use bd_dev to generate index when dev_state_hashtable add items.

2017-10-11 Thread Nikolay Borisov
On 11.10.2017 04:55, Gu Jinxiang wrote: > From: Gu JinXiang > > Fix bug of > (). > > Description of this bug: > Use MOUNT_OPTIONS="-o check_int" when run xfstest, device can not be > mount successfully. So xfstest can not run. You haven't described what causes the bug

Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices

2017-10-11 Thread Anand Jain
On 10/11/2017 02:11 PM, Anand Jain wrote: On 10/11/2017 05:51 AM, Liu Bo wrote: It was introduced because btrfs used to do blkdev_put in a deferred work, now that btrfs has put blkdev in place, this rcu_barrier can be removed. On the 2nd thought, modprobe -r btrfs would still need

Re: [PATCH 4/5] cgroup, buffer_head: implement submit_bh_blkcg_css()

2017-10-11 Thread Jan Kara
On Tue 10-10-17 08:54:40, Tejun Heo wrote: > Implement submit_bh_blkcg_css() which will be used to override cgroup > membership on specific buffer_heads. > > v2: Reimplemented using create_bh_bio() as suggested by Jan. > > Signed-off-by: Tejun Heo > Cc: Jan Kara

Re: [PATCH 3/5] buffer_head: separate out create_bh_bio() from submit_bh_wbc()

2017-10-11 Thread Jan Kara
On Tue 10-10-17 08:54:39, Tejun Heo wrote: > submit_bh_wbc() creates a bio matching the specific @bh and submits it > at the end. This patch separates out the bio creation part to its own > function, create_bh_bio(), and reimplement submit_bh[_wbc]() using the > function. > > As bio can now be

Re: [PATCH v3] btrfs: Use bd_dev to generate index when dev_state_hashtable add items.

2017-10-11 Thread Nikolay Borisov
On 11.10.2017 12:16, Nikolay Borisov wrote: > > > On 11.10.2017 11:44, Gu Jinxiang wrote: >> From: Gu JinXiang >> >> Fix missing modify of >> commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t"). >> Function btrfsic_dev_state_hashtable_lookup use

Re: [PATCH] Btrfs-progs: do not add stale device into fs_devices

2017-10-11 Thread Nikolay Borisov
On 11.10.2017 03:28, Liu Bo wrote: > If one of btrfs's devices was pulled out and we've replaced it with a > new one, then they have the same uuid. > > If that device gets reconnected, 'btrfs filesystem show' will show the > stale one instead of the new one, but on kernel side btrfs has a fix >

Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Ian Kumlien
Hi, I was running a btrfs raid with 6 disks, metadata: dup and data: raid 6 Two of the disks started behaving oddly: [436823.570296] sd 3:1:0:4: [sdf] Unaligned partial completion (resid=244, sector_sz=512) [436823.578604] sd 3:1:0:4: [sdf] Unaligned partial completion (resid=52, sector_sz=512)

Re: [PATCH] btrfs: fix max chunk size on dup

2017-10-11 Thread Hans van Kranenburg
On 10/11/2017 11:58 AM, Naohiro Aota wrote: > Hi, > > You may notice my @wdc.com address is bounced. As my internship job at > wdc is finished, the address is already expired. > Please contact me on this @elisp.net address. > > 2017-10-11 2:42 GMT+09:00 Hans van Kranenburg >

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Jeff Mahoney
On 10/11/17 12:41 PM, Ian Kumlien wrote: > Hi, > > I was running a btrfs raid with 6 disks, metadata: dup and data: raid 6 > > Two of the disks started behaving oddly: > [436823.570296] sd 3:1:0:4: [sdf] Unaligned partial completion > (resid=244, sector_sz=512) > [436823.578604] sd 3:1:0:4:

Re: [PATCH v4 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf

2017-10-11 Thread Qu Wenruo
On 2017年10月11日 23:41, Nikolay Borisov wrote: On 9.10.2017 04:51, Qu Wenruo wrote: Enhance the output to print: 1) Reason 2) Bad value If reason can't explain enough 3) Good value (range) Signed-off-by: Qu Wenruo --- fs/btrfs/tree-checker.c | 27

btrfs seed question

2017-10-11 Thread Joseph Dunn
After seeing how btrfs seeds work I wondered if it was possible to push specific files from the seed to the rw device. I know that removing the seed device will flush all the contents over to the rw device, but what about flushing individual files on demand? I found that opening a file, reading

[RFC] Btrfs: compression heuristic performance

2017-10-11 Thread Timofey Titovets
Hi David, (and list folks in CC of course). TL;DR Sorting is a slowest part of heuristic for now (in worst case ~55% of run time). Kernel use heap sort, i.e. heuristic also use that. Radix sort speedup heuristic a lot (~+30-40%). But radix have some tradeoffs (i.e. need more memory, but that can

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Ian Kumlien
On Wed, Oct 11, 2017 at 2:42 PM, Jeff Mahoney wrote: > On 10/11/17 2:20 PM, Ian Kumlien wrote: >> >> >> On Wed, Oct 11, 2017 at 2:10 PM Jeff Mahoney > > wrote: >> >> On 10/11/17 12:41 PM, Ian Kumlien wrote: >> >> [--8<--] >> >> >

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Ian Kumlien
Resent since google inbox is still not doing clear-text emails... On Wed, Oct 11, 2017 at 2:09 PM, Jeff Mahoney wrote: > On 10/11/17 12:41 PM, Ian Kumlien wrote: [--8<---] >> Eventually the filesystem becomes read-only and everything is odd... > > Are you still able to mount

Re: Fatal failure, btrfs raid with duplicated metadata

2017-10-11 Thread Jeff Mahoney
On 10/11/17 2:20 PM, Ian Kumlien wrote: > > > On Wed, Oct 11, 2017 at 2:10 PM Jeff Mahoney > wrote: > > On 10/11/17 12:41 PM, Ian Kumlien wrote: > > [--8<--]  > > > Eventually the filesystem becomes read-only and everything is odd... > >

[PATCH] btrfs: set include path relatively

2017-10-11 Thread Naohiro Aota
Currently, gcc is passed the include directory with full path. As a result, dependency files (*.o.d) also record the full path at the build time. Such full path dependency is annoying for sharing the source between multiple machines, containers, or anything the path differ. And this is the same

Re: USB upgrade fun

2017-10-11 Thread Kai Hendry
A guy on #btrsfs suggests: 15:09 hendry: super_total_bytes 8001581707264 mismatch with fs_devices total_rw_bytes 8001581710848 that one is because unaligned partitions, 4.12 - 4.13 kernels are affected (at least some versions) However I rebooted into 4.9.54-1-lts and I have the same issue.

Re: [PATCH v4 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf

2017-10-11 Thread Nikolay Borisov
On 12.10.2017 03:28, Qu Wenruo wrote: > > > On 2017年10月11日 23:41, Nikolay Borisov wrote: >> >> >> On  9.10.2017 04:51, Qu Wenruo wrote: >>> Enhance the output to print: >>> 1) Reason >>> 2) Bad value >>>     If reason can't explain enough >>> 3) Good value (range) >>> >>> Signed-off-by: Qu

Re: btrfs seed question

2017-10-11 Thread Anand Jain
On 10/12/2017 08:47 AM, Joseph Dunn wrote: After seeing how btrfs seeds work I wondered if it was possible to push specific files from the seed to the rw device. I know that removing the seed device will flush all the contents over to the rw device, but what about flushing individual files on

Re: [PATCH v2 5/5] btrfs: ensure that metadata and flush are issued from the root cgroup

2017-10-11 Thread David Sterba
On Tue, Oct 10, 2017 at 09:43:26AM -0700, Tejun Heo wrote: > >From 3bbed8c7747739cda48f592f165e8839da076a3a Mon Sep 17 00:00:00 2001 > > Issuing metdata or otherwise shared IOs from !root cgroup can lead to > priority inversion. This patch ensures that those IOs are always > issued from the root

Re: [PATCH 3/3] Btrfs: remove nr_async_submits and async_submit_draining

2017-10-11 Thread David Sterba
On Wed, Sep 27, 2017 at 02:31:17PM +0200, David Sterba wrote: > On Thu, Sep 07, 2017 at 11:22:22AM -0600, Liu Bo wrote: > > Now that we have the combo of flushing twice, which can make sure IO > > have started since the second flush will wait for page lock which > > won't be unlocked unless

Re: [PATCH v4 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf

2017-10-11 Thread Nikolay Borisov
On 9.10.2017 04:51, Qu Wenruo wrote: > Enhance the output to print: > 1) Reason > 2) Bad value >If reason can't explain enough > 3) Good value (range) > > Signed-off-by: Qu Wenruo > --- > fs/btrfs/tree-checker.c | 27 +-- > 1 file changed,

[PATCH v2] Btrfs-progs: do not add stale device into fs_devices

2017-10-11 Thread Liu Bo
If one of btrfs's devices was pulled out and we've replaced it with a new one, then they have the same uuid. If that device gets reconnected, 'btrfs filesystem show' will show the stale one instead of the new one, but on kernel side btrfs has a fix to not include the stale one, this could confuse

[PATCH v2] Btrfs: free btrfs_device in place

2017-10-11 Thread Liu Bo
It's pointless to defer it to a kthread helper as we're not under any special context. A bit more about device's lifetime, filesystems use an exclusive way to access devices and hold a reference count on the devices in use. Now that we've run blkdev_put() in btrfs_close_bdev(), device->bdev's

Re: [PATCH] Btrfs-progs: do not add stale device into fs_devices

2017-10-11 Thread Anand Jain
On 10/11/2017 05:33 PM, Nikolay Borisov wrote: On 11.10.2017 03:28, Liu Bo wrote: If one of btrfs's devices was pulled out and we've replaced it with a new one, then they have the same uuid. If that device gets reconnected, 'btrfs filesystem show' will show the stale one instead of the new

Re: [PATCH] Btrfs: free btrfs_device in place

2017-10-11 Thread David Sterba
On Tue, Oct 10, 2017 at 03:51:03PM -0600, Liu Bo wrote: > It's pointless to defer it to a kthread helper as we're not under any > special context. I agree the doubly deferred freeing is pointless. It's a weird mix of RCU and workques and understanding all the interactions turned out to be hard,

Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices

2017-10-11 Thread Liu Bo
On Wed, Oct 11, 2017 at 03:41:23PM +0800, Anand Jain wrote: > > > On 10/11/2017 02:11 PM, Anand Jain wrote: > > > > > > On 10/11/2017 05:51 AM, Liu Bo wrote: > > > It was introduced because btrfs used to do blkdev_put in a deferred > > > work, now that btrfs has put blkdev in place, this

Re: [PATCH 3/3] Btrfs: remove nr_async_submits and async_submit_draining

2017-10-11 Thread Liu Bo
On Wed, Oct 11, 2017 at 07:20:32PM +0200, David Sterba wrote: > On Wed, Sep 27, 2017 at 02:31:17PM +0200, David Sterba wrote: > > On Thu, Sep 07, 2017 at 11:22:22AM -0600, Liu Bo wrote: > > > Now that we have the combo of flushing twice, which can make sure IO > > > have started since the second

Re: [PATCH] Btrfs-progs: do not add stale device into fs_devices

2017-10-11 Thread Liu Bo
On Wed, Oct 11, 2017 at 12:33:15PM +0300, Nikolay Borisov wrote: > > > On 11.10.2017 03:28, Liu Bo wrote: > > If one of btrfs's devices was pulled out and we've replaced it with a > > new one, then they have the same uuid. > > > > If that device gets reconnected, 'btrfs filesystem show' will

Re: [PATCH v4 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf

2017-10-11 Thread David Sterba
On Wed, Oct 11, 2017 at 06:41:32PM +0300, Nikolay Borisov wrote: > > > On 9.10.2017 04:51, Qu Wenruo wrote: > > Enhance the output to print: > > 1) Reason > > 2) Bad value > >If reason can't explain enough > > 3) Good value (range) > > > > Signed-off-by: Qu Wenruo

Re: [PATCH v4 0/5] Enhance tree block validation checker

2017-10-11 Thread David Sterba
On Mon, Oct 09, 2017 at 01:51:01AM +, Qu Wenruo wrote: > The patchset can be fetched from github: > https://github.com/adam900710/linux/tree/checker_enhance > > It's based on David's misc-next branch, with following commit as base: > a5e50b4b444c ("btrfs: Add checker for EXTENT_CSUM") > >

Re: [PATCH 3/3] Btrfs: remove nr_async_submits and async_submit_draining

2017-10-11 Thread David Sterba
On Wed, Oct 11, 2017 at 10:49:14AM -0600, Liu Bo wrote: > On Wed, Oct 11, 2017 at 07:20:32PM +0200, David Sterba wrote: > > On Wed, Sep 27, 2017 at 02:31:17PM +0200, David Sterba wrote: > > > On Thu, Sep 07, 2017 at 11:22:22AM -0600, Liu Bo wrote: > > > > Now that we have the combo of flushing

Re: [PATCH] Btrfs: free btrfs_device in place

2017-10-11 Thread Liu Bo
On Wed, Oct 11, 2017 at 07:54:04PM +0200, David Sterba wrote: > On Tue, Oct 10, 2017 at 03:51:03PM -0600, Liu Bo wrote: > > It's pointless to defer it to a kthread helper as we're not under any > > special context. > > I agree the doubly deferred freeing is pointless. It's a weird mix of > RCU

Re: [PATCH] Btrfs: remove rcu_barrier in btrfs_close_devices

2017-10-11 Thread Anand Jain
On 10/11/2017 05:51 AM, Liu Bo wrote: It was introduced because btrfs used to do blkdev_put in a deferred work, now that btrfs has put blkdev in place, this rcu_barrier can be removed. Reviewed-by: Anand Jain Thanks, Anand Signed-off-by: Liu Bo

Re: [PATCH] Btrfs-progs: do not add stale device into fs_devices

2017-10-11 Thread Anand Jain
On 10/11/2017 08:28 AM, Liu Bo wrote: If one of btrfs's devices was pulled out and we've replaced it with a new one, then they have the same uuid. If that device gets reconnected, 'btrfs filesystem show' will show the stale one instead of the new one, but on kernel side btrfs has a fix to not