Re: [PATCH V7 1/3] btrfs: Introduce new mount option usebackuproot to replace recovery

2016-02-12 Thread David Sterba
On Tue, Jan 19, 2016 at 10:23:02AM +0800, Qu Wenruo wrote: > diff --git a/Documentation/filesystems/btrfs.txt > b/Documentation/filesystems/btrfs.txt > index c772b47..8e22d92 100644 > --- a/Documentation/filesystems/btrfs.txt > +++ b/Documentation/filesystems/btrfs.txt > @@ -168,10 +168,13 @@

Re: [PATCH V7 0/3][PULL REQUEST] Unify 'norecovery' bahavior with other filesystems

2016-02-12 Thread David Sterba
On Fri, Jan 29, 2016 at 11:17:48AM +0800, Qu Wenruo wrote: > Ping. > > Any comment? > Or will it be merged into current 4.5? I've fixed the 1/3 and will add this patchset to my for-next, scheduled for 4.6. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a

[GIT PULL] Btrfs

2016-02-12 Thread Chris Mason
Hi Linus, Please pull my for-linus-4.5 branch: git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus-4.5 This has a few fixes from Filipe, along with a readdir fix from Dave that we've been testing for some time. Filipe Manana (4) commits (+115/-68): Btrfs: remove

Re: btrfs-image failure (btrfs-tools 4.4)

2016-02-12 Thread Marc MERLIN
On Fri, Feb 12, 2016 at 08:33:11AM +0800, Qu Wenruo wrote: > There is still a last chance. > > If btrfsck still report original error about "bad file extent" in root: > 45851/45852/... > Btrfs-debug-tree may provide useful info by dumping only that root. > > # btrfs-debug-tree -t 45851 > >

btrfs on top of bcache on top of dmcrypt on top of md raid5

2016-02-12 Thread Marc MERLIN
I have a 5 drive md array with dmcrypt on top, and btrfs on top of that. Kernel: 4.4 but the filesystem was created 2 years ago with an older version of btrfs. It's littered with files and hardlinks (it's a backup server). Mostly it gets btrfs receive data, and rsyncs of filesystem trees that are

Re: [PATCH 12/32] dio: unwritten conversion bug tests

2016-02-12 Thread Theodore Ts'o
On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > Check that we don't expose old disk contents when a directio write to > > an unwritten extent fails due to IO errors. This primarily affects > > XFS and ext4. > >

[PATCH] Btrfs: fix file loss on log replay after renaming a file and fsync

2016-02-12 Thread fdmanana
From: Filipe Manana We have two cases where we end up deleting a file at log replay time when we should not. For this to happen the file must have been renamed and a directory inode must have been fsynced/logged. Two examples that exercise these two cases are listed below.

[PATCH 1/2] fstests: generic test for directory fsync after rename operation

2016-02-12 Thread fdmanana
From: Filipe Manana Test that if we move one file between directories, fsync the parent directory of the old directory, power fail and remount the filesystem, the file is not lost and it's located at the destination directory. This is motivated by a bug found in btrfs, which

[PATCH] Btrfs: fix extent_same allowing destination offset beyond i_size

2016-02-12 Thread fdmanana
From: Filipe Manana When using the same file as the source and destination for a dedup (extent_same ioctl) operation we were allowing it to dedup to a destination offset beyond the file's size, which doesn't make sense and it's not allowed for the case where the source and

[PATCH] fstests: generic/158, test dedupe with destination offset past EOF

2016-02-12 Thread fdmanana
From: Filipe Manana We were testing when the source file offset starts at EOF or beyond, but not when the destination offset is beyond EOF or when the destination offset is smaller than EOF but destination offset plus dedup length is greater than EOF. This is motivated by a

[PATCH 2/2] fstests: generic test for file fsync after rename operation

2016-02-12 Thread fdmanana
From: Filipe Manana Test that if we have a file F1 with two links, one in a directory A and the other in directory B, if we remove the link in directory B, move some other file F2 from directory B into directory C, fsync inode F1, power fail and remount the filesystem, file F2

Re: [PATCH] fstests: generic/158, test dedupe with destination offset past EOF

2016-02-12 Thread Darrick J. Wong
On Fri, Feb 12, 2016 at 04:23:59PM +, fdman...@kernel.org wrote: > From: Filipe Manana > > We were testing when the source file offset starts at EOF or beyond, > but not when the destination offset is beyond EOF or when the > destination offset is smaller than EOF but

[PATCH v2] fstests: generic/158, test dedupe with destination offset past EOF

2016-02-12 Thread Darrick J. Wong
From: Filipe Manana We were testing when the source file offset starts at EOF or beyond, but not when the destination offset is beyond EOF or when the destination offset is smaller than EOF but destination offset plus dedup length is greater than EOF. This is motivated by a

Re: [PATCH 12/32] dio: unwritten conversion bug tests

2016-02-12 Thread Darrick J. Wong
On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > Check that we don't expose old disk contents when a directio write to > > an unwritten extent fails due to IO errors. This primarily affects > > XFS and ext4. > >

Re: [PATCH 0/7] Introduce device delete by devid

2016-02-12 Thread David Sterba
On Tue, Oct 06, 2015 at 11:19:17PM +0800, Anand Jain wrote: > The operation of device replace and device delete follows same steps > upto some depths, however they don't share codes. > This set of enhancement will help device replace and device delete to > share codes. > And at the end add support

[PATCH 33/32] aiocp: fix the gcc warnings

2016-02-12 Thread Darrick J. Wong
Eliminate a debug printf that was causing warnings and fix the other two debug printfs to avoid tripping on return value warnings. Signed-off-by: Darrick J. Wong --- src/aio-dio-regress/aiocp.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

Re: task btrfs-cleaner:770 blocked for more than 120 seconds.

2016-02-12 Thread Михаил Гаврилов
2016-02-12 8:22 GMT+05:00 Liu Bo : > You can try it on your 4.2.3 kernel or the latest 4.5, but I guess it > doesn't not fix the real deadlock you're hitting... It means it is not final patch? you continue investigate problem? Can I help you? -- Best Regards, Mike Gavrilov.

Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls

2016-02-12 Thread Darrick J. Wong
On Sat, Feb 13, 2016 at 12:26:59PM +1100, Dave Chinner wrote: > On Thu, Feb 11, 2016 at 03:39:16PM -0800, Darrick J. Wong wrote: > > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > > you'd like to pull. See the pull request at the end of this message. > > > > This is a

enospc while having a lot of free space with kernel 4.4

2016-02-12 Thread Stefan Priebe
Hi, while running 4.4 i got the following enospc error today: [813092.863118] BTRFS info (device dm-0): 9 enospc errors during balance [813124.251578] [ cut here ] [813124.317337] WARNING: CPU: 16 PID: 12647 at fs/btrfs/extent-tree.c:5627

Re: task btrfs-cleaner:770 blocked for more than 120 seconds.

2016-02-12 Thread Liu Bo
On Sat, Feb 13, 2016 at 12:15:08AM +0500, Михаил Гаврилов wrote: > 2016-02-12 8:22 GMT+05:00 Liu Bo : > > You can try it on your 4.2.3 kernel or the latest 4.5, but I guess it > > doesn't not fix the real deadlock you're hitting... > > It means it is not final patch? you

Re: task btrfs-cleaner:770 blocked for more than 120 seconds.

2016-02-12 Thread Liu Bo
On Thu, Feb 11, 2016 at 08:38:36PM -0700, Chris Murphy wrote: > On Thu, Feb 11, 2016 at 8:22 PM, Liu Bo wrote: > > On Fri, Feb 12, 2016 at 02:03:15AM +0500, Михаил Гаврилов wrote: > >> Thanks guys, I appreciate your's work. > >> In which kernel this patch would landed? > > >

Re: [PATCH 12/32] dio: unwritten conversion bug tests

2016-02-12 Thread Dave Chinner
On Fri, Feb 12, 2016 at 10:22:31AM -0500, Theodore Ts'o wrote: > On Fri, Feb 12, 2016 at 02:52:53PM +1100, Dave Chinner wrote: > > On Thu, Feb 11, 2016 at 03:40:37PM -0800, Darrick J. Wong wrote: > > > Check that we don't expose old disk contents when a directio write to > > > an unwritten extent

[PATCH resend 00/13] misc patches plus Introduce device delete by devid

2016-02-12 Thread Anand Jain
Hi Dave, These patches are based on top of your for-next. Patch 1-5 are miscellaneous fixes which were sent before as independent patch, they aren't related to the patch set 'Introduce device delete by devid' but they are included here as the patch apply may fail without them. Patch 6-12 are

[PATCH v2 08/13] btrfs: create helper btrfs_find_device_by_user_input()

2016-02-12 Thread Anand Jain
The patch renames btrfs_dev_replace_find_srcdev() to btrfs_find_device_by_user_input() and moves it to volumes.c, so that delete device can use it. Signed-off-by: Anand Jain --- v2: changed title from 'Btrfs: rename btrfs_dev_replace_find_srcdev()' and commit

[PATCH 09/13] btrfs: make use of btrfs_find_device_by_user_input()

2016-02-12 Thread Anand Jain
btrfs_rm_device() has a section of the code which can be replaced btrfs_find_device_by_user_input() Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 100 - 1 file changed, 37 insertions(+), 63 deletions(-) diff --git

[PATCH v2 06/13] btrfs: create helper function __check_raid_min_devices()

2016-02-12 Thread Anand Jain
move a section of btrfs_rm_device() code to check for min number of the devices into the function __check_raid_min_devices() Signed-off-by: Anand Jain --- v2: commit update and title renamed from Btrfs: move check for min number of devices to a function

Re: [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls

2016-02-12 Thread Dave Chinner
On Thu, Feb 11, 2016 at 03:39:16PM -0800, Darrick J. Wong wrote: > Dave Chinner: I've renumbered the new tests and pushed to github[3] if > you'd like to pull. See the pull request at the end of this message. > > This is a patch set against the reflink/dedupe test cases in xfstests. > The first

Is there now a way to migrate FS without losing shared COW blocks between subvolumes?

2016-02-12 Thread Marc MERLIN
btrfs send lets you keep COW blocks within a subvolume. But if I have lots of backups where subvolumes have shared data, and I need to migrate this to a new filesystem, is there a decent way? I know I can btrfs device add new drive as raid1, but I'm trying to migrate off an old filesystem that

[PATCH v2 01/13] btrfs: pass the error code to the btrfs_std_error and log ret

2016-02-12 Thread Anand Jain
This patch will log return value of add/del_qgroup_relation() and pass the err code of btrfs_run_qgroups to the btrfs_std_error(). Signed-off-by: Anand Jain --- v2: fix the forgotten git commit amend, to take in compile fail, sorry fs/btrfs/ioctl.c | 7 ++- 1 file

[PATCH v2 03/13] btrfs: maintain consistency in logging to help debugging

2016-02-12 Thread Anand Jain
Optional Label may or may not be set, or it might be set at some time later. However while debugging to search through the kernel logs the scripts would need the logs to be consistent, so logs search key words shouldn't depend on the optional variables, instead fsid is better. Signed-off-by:

[PATCH 05/13] Btrfs: fix fs logging for multi device

2016-02-12 Thread Anand Jain
In case of multi device btrfs fs, using one of device for the logging purpose it quite confusing, instead use the fsid. FSID is bit long, but the device path can be long as well in some cases. Signed-off-by: Anand Jain --- fs/btrfs/super.c | 4 ++-- 1 file changed, 2

[PATCH v2 11/13] btrfs: make use of btrfs_scratch_superblocks() in btrfs_rm_device()

2016-02-12 Thread Anand Jain
With the previous patches now the btrfs_scratch_superblocks() is ready to be used in btrfs_rm_device() so use it. Signed-off-by: Anand Jain --- v2: changelog update fs/btrfs/volumes.c | 78 ++ 1 file changed, 14

[PATCH v4 12/13] btrfs: introduce device delete by devid

2016-02-12 Thread Anand Jain
This introduces new ioctl BTRFS_IOC_RM_DEV_V2, which uses enhanced struct btrfs_ioctl_vol_args_v2 to carry devid as an user argument. The patch won't delete the old ioctl interface and so kernel remains backward compatible with user land progs. Test case/script: echo "0 $(blockdev --getsz

[PATCH 02/13] btrfs: create a helper function to read the disk super

2016-02-12 Thread Anand Jain
A part of code from btrfs_scan_one_device() is moved to a new function btrfs_read_disk_super(), so that former function looks cleaner. (In this process it also moves the code which ensures null terminating label). So this creates easy opportunity to merge various duplicate codes on read disk

[PATCH v2 04/13] btrfs: device path change must be logged

2016-02-12 Thread Anand Jain
>From the issue diagnosable point of view, log if the device path is changed. Signed-off-by: Anand Jain --- V2: Accepts David's review comment and adds a new ret value 2 for device_list_add() and based on that the caller function would indicate if the path is

[PATCH 07/13] btrfs: clean up and optimize __check_raid_min_device()

2016-02-12 Thread Anand Jain
__check_raid_min_device() which was pealed from btrfs_rm_device() maintianed its original code to show the block move. This patch cleans up __check_raid_min_device(). Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 43 +++ 1 file

[PATCH v2 10/13] btrfs: enhance btrfs_find_device_by_user_input() to check device path

2016-02-12 Thread Anand Jain
The operation of device replace and device delete follows same steps upto some depth with in btrfs kernel, however they don't share codes. This enhancement will help replace and delete to share codes. Signed-off-by: Anand Jain --- v2: reword subject from Btrfs: check

[PATCH 13/13] btrfs: optimize check for stale device

2016-02-12 Thread Anand Jain
Optimize check for stale device to only be checked when there is device added or changed. If there is no update to the device, there is no need to call btrfs_free_stale_device(). Signed-off-by: Anand Jain --- This is good to go. The there were some stale devices while

Re: [PATCH 0/7] Introduce device delete by devid

2016-02-12 Thread Anand Jain
On 02/13/2016 02:22 AM, David Sterba wrote: On Tue, Oct 06, 2015 at 11:19:17PM +0800, Anand Jain wrote: The operation of device replace and device delete follows same steps upto some depths, however they don't share codes. This set of enhancement will help device replace and device delete to