[PATCH RFC] btrfs: Slightly speedup btrfs_read_block_groups

2016-05-05 Thread Qu Wenruo
Btrfs_read_block_groups() function is the most time consuming function if the whole fs is filled with small extents. For a btrfs filled with all 16K sized files, and when 2T space is used, mount the fs needs 10 to 12 seconds. While ftrace shows that, btrfs_read_block_groups() takes about 9 second

Re: [PATCH] btrfs-progs: Adjust timing of safety delay countdown

2016-05-05 Thread David Sterba
On Wed, May 04, 2016 at 03:43:26PM -0400, Noah Massey wrote: > When printing the countdown in the safety delay, the number should > correspond to the number of seconds remaining to wait at the time the > delay is printed. > > In other words, there should be a one second sleep after printing '1'. >

Re: [PATCH] btrfs: don't force mounts to wait for cleaner_kthread to delete one or more subvolumes

2016-05-05 Thread Filipe Manana
On Thu, May 5, 2016 at 5:23 AM, Zygo Blaxell wrote: > During a mount, we start the cleaner kthread first because the transaction > kthread wants to wake up the cleaner kthread. We start the transaction > kthread next because everything in btrfs wants transactions. We do reloc > recovery in the t

Re: btrfs ate my data in just two days, after a fresh install. ram and disk are ok. it still mounts, but I cannot repair

2016-05-05 Thread Niccolò Belli
On giovedì 5 maggio 2016 03:07:37 CEST, Chris Murphy wrote: I suggest using defaults for starters. The only thing in that list that needs be there is either subvolid or subvold, not both. Add in the non-default options once you've proven the defaults are working, and add them one at a time. Yes

Re: Spare volumes and hot auto-replacement feature

2016-05-05 Thread Austin S. Hemmelgarn
On 2016-05-04 19:18, Dmitry Katsubo wrote: Dear btrfs community, I am interested in spare volumes and hot auto-replacement feature [1]. I have a couple of questions: * Which kernel version this feature will be included? Probably 4.7. I would not suggest using it in production for at least a

Re: Spare volumes and hot auto-replacement feature

2016-05-05 Thread Anand Jain
Most of it (like policy tuning/configuring/notification) is through sysfs interface, However to implement this, we need the existing sysfs volume patches to be integrated. We need to think about the implementation of per-FSID spare which I hope will solve the problem incompatible spare disk. As

[PATCH 0/4] Improve compression workspaces memory management

2016-05-05 Thread David Sterba
Hi, the compression workspaces are allocated as needed an this could fail if there's no free memory. Moreover, as we might be flushing data from the restricted contexts we should try our best not to fail. This patchset preallocates one workspace for each compression type at module load time (and

[PATCH 1/4] btrfs: rename and document compression workspace members

2016-05-05 Thread David Sterba
The names are confusing, pick more fitting names and add comments. Signed-off-by: David Sterba --- fs/btrfs/compression.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index ff61a41ac90b..

[PATCH 4/4] btrfs: make find_workspace warn if there are no workspaces

2016-05-05 Thread David Sterba
Be verbose if there are no workspaces at all, ie. the module init time preallocation failed. Signed-off-by: David Sterba --- fs/btrfs/compression.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index c70625560265..658c39b70fba

[PATCH 3/4] btrfs: make find_workspace always succeed

2016-05-05 Thread David Sterba
With just one preallocated workspace we can guarantee forward progress even if there's no memory available for new workspaces. The cost is more waiting but we also get rid of several error paths. On average, there will be several idle workspaces, so the waiting penalty won't be so bad. In the wor

[PATCH 2/4] btrfs: preallocate compression workspaces

2016-05-05 Thread David Sterba
Preallocate one workspace for each compression type so we can guarantee forward progress in the worst case. A failure cannot be a hard error as we might not use compression at all on the filesystem. If we can't allocate the workspaces later when need them, it might actually deadlock, but in such si

[PATCH 3/3] Btrfs: pin logs earlier when doing a rename exchange operation

2016-05-05 Thread fdmanana
From: Filipe Manana The btrfs_rename_exchange() started as a copy-paste from btrfs_rename(), which had a race fixed by my previous patch titled "Btrfs: pin log earlier when renaming", and so it suffers from the same problem. We pin the logs of the affected roots after we insert the new inode ref

[PATCH 2/3] Btrfs: unpin logs if rename exchange operation fails

2016-05-05 Thread fdmanana
From: Filipe Manana If rename exchange operations fail at some point after we pinned any of the logs, we end up aborting the current transaction but never unpin the logs, which leaves concurrent tasks that are trying to sync the logs (as part of an fsync request from user space) blocked forever a

[PATCH 1/3] Btrfs: fix inode leak on failure to setup whiteout inode in rename

2016-05-05 Thread fdmanana
From: Filipe Manana If we failed to fully setup the whiteout inode during a rename operation with the whiteout flag, we ended up leaking the inode, not decrementing its link count nor removing all its items from the fs/subvol tree. Signed-off-by: Filipe Manana --- fs/btrfs/inode.c | 12 ++-

Re: btrfs ate my data in just two days, after a fresh install. ram and disk are ok. it still mounts, but I cannot repair

2016-05-05 Thread Omar Sandoval
On Thu, May 05, 2016 at 12:36:52PM +0200, Niccolò Belli wrote: > On giovedì 5 maggio 2016 03:07:37 CEST, Chris Murphy wrote: > > I suggest using defaults for starters. The only thing in that list > > that needs be there is either subvolid or subvold, not both. Add in > > the non-default options onc

[RFC 0/3] getfsmapx ioctl

2016-05-05 Thread Darrick J. Wong
Hi, Building on the discussion "Exposing Extent Information to Userspace" at LSF, this patchset offers the userspace definition, implementation, and manpages for a new FS_IOC_GETFSMAPX ioctl that enables userspace to query the filesystem for a map of every extent in a given range of physical block

[PATCH 1/3] document the XFS_IOC_GETFSMAPX ioctl

2016-05-05 Thread Darrick J. Wong
Document the new XFS_IOC_GETFSMAPX that returns the physical layout of a (disk-based) filesystem. (Yes, the leading 'X' needs to fall off...) Signed-off-by: Darrick J. Wong --- man2/ioctl_getfsmapx.2 | 253 1 file changed, 253 insertions(+) cre

[PATCH 2/3] xfs: introduce the XFS_IOC_GETFSMAPX ioctl

2016-05-05 Thread Darrick J. Wong
Introduce a new ioctl that uses the reverse mapping btree to return information about the physical layout of the filesystem. This is the xfsprogs side of things for userspace support. Signed-off-by: Darrick J. Wong --- libxfs/xfs_fs.h | 65 +++

[PATCH 3/3] xfs_io: support the new getfsmap ioctl

2016-05-05 Thread Darrick J. Wong
Add a new command, 'fsmap', to xfs_io so that we can query the filesystem extent map on a live filesystem. Signed-off-by: Darrick J. Wong --- io/Makefile |2 io/fsmap.c| 485 + io/init.c |1 io/io.h |

Re: [PATCH 0/2] scop GFP_NOFS api

2016-05-05 Thread NeilBrown
On Wed, May 04 2016, Dave Chinner wrote: > FWIW, I don't think making evict() non-blocking is going to be worth > the effort here. Making memory reclaim wait on a priority ordered > queue while asynchronous reclaim threads run reclaim as efficiently > as possible and wakes waiters as it frees the