[PATCH 2/3] generic/15[78]: fix error messages in the golden output

2015-12-07 Thread Darrick J. Wong
Fix the error messages in the golden output for generic/15[78], which examine the responses to invalid inputs as returned by the clone/clone_range/extent_same ioctls. Also fix a filtering omission. Signed-off-by: Darrick J. Wong --- tests/generic/157 | 18

[PATCH 3/3] reflink: more tests

2015-12-07 Thread Darrick J. Wong
Add more tests for unaligned copy-on-write things, and explicitly test the ability to pass "len == 0" to mean reflink/dedupe all the way to the end of the file". Signed-off-by: Darrick J. Wong --- tests/generic/820 | 77

[PATCH v3.4 0/3] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls

2015-12-07 Thread Darrick J. Wong
Hi all, This is a small patch set against the reflink/dedupe test cases in xfstests. The first patch is a rewrite of the tools to find the lowest vacant ID number and to move a test case. These two programs are useful for staging a lot of new tests at a high number and moving them to lower

Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Qu Wenruo
Roman Mamedov wrote on 2015/12/08 11:31 +0500: On Tue, 8 Dec 2015 14:10:33 +0800 Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Maybe name it

Re: [PATCH v2] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Roman Mamedov
On Tue, 8 Dec 2015 14:10:33 +0800 Qu Wenruo wrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. Maybe name it "norecovery" too, for simplicity and consistency? The

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Qu Wenruo
Austin S Hemmelgarn wrote on 2015/12/07 11:36 -0500: On 2015-12-07 01:06, Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags at

[PATCH v2] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Qu Wenruo
Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags at remount time, so add a new parameter for parse_options(). Signed-off-by: Qu Wenruo

[PATCH 1/3] test-scripts: test migration scripts

2015-12-07 Thread Darrick J. Wong
Add two scripts: "nextid" finds the next available test ID number in a group, and "mvtest" relocates a test, fixes the golden output, and moves the group entry for that test. v2: sorting group files should preserve group order; nextid should use the same algorithm as new; move both tools to

RE: [PATCH] fstests: Fix generic/102 fail for btrfs

2015-12-07 Thread Zhao Lei
Hi, Dave Chinner > -Original Message- > From: Dave Chinner [mailto:da...@fromorbit.com] > Sent: Tuesday, December 08, 2015 6:12 AM > To: Zhaolei > Cc: fste...@vger.kernel.org; linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] fstests: Fix generic/102 fail for

[PATCH v2 2/2] btrfs: Enhance chunk validation check

2015-12-07 Thread Qu Wenruo
Enhance chunk validation: 1) Num_stripes We already have such check but it's only in super block sys chunk array. Now check all on-disk chunks. 2) Chunk logical It should be aligned to sector size. This behavior should be *DOUBLE CHECKED* for 64K sector size like PPC64 or

[PATCH v2 1/2] btrfs: Enhance super validation check

2015-12-07 Thread Qu Wenruo
Enhance btrfs_check_super_valid() function by the following points: 1) Restrict sector/node size check Not the old max/min valid check, but also check if it's a power of 2. So some bogus number like 12K node size won't pass now. 2) Super flag check For now, there is still some

Re: Fixing recursive fault and parent transid verify failed

2015-12-07 Thread Duncan
Alistair Grant posted on Mon, 07 Dec 2015 21:02:56 +1100 as excerpted: > I think I'll try the btrfs restore as a learning exercise, and to check > the contents of my backup (I don't trust my memory, so something could > have changed since the last backup). Trying btrfs restore is an excellent

Re: [PULL][PATCH 00/12] Minor cleanups and code simplifications

2015-12-07 Thread David Sterba
On Thu, Dec 03, 2015 at 05:56:19PM +0100, David Sterba wrote: > > The following changes since commit 1ec218373b8ebda821aec00bb156a9c94fad9cd4: > > David Sterba (12): > btrfs: make btrfs_close_one_device static > btrfs:

Re: [PATCH 04/12] btrfs: change how delay_iput is tracked in btrfs_delalloc_work

2015-12-07 Thread David Sterba
On Fri, Dec 04, 2015 at 01:50:39PM +0100, Holger Hoffstätte wrote: > On 12/04/15 13:36, David Sterba wrote: > [snip] > > As the use of the inode pointer is limited, I don't think this would > > cause surprises. And it's commented where used which should help during > > debugging. > > When I read

Re: [PATCH 0/3] btrfs-progs: fix file restore to lost+found bug

2015-12-07 Thread David Sterba
On Mon, Dec 07, 2015 at 11:59:19AM +0900, Naohiro Aota wrote: > > But I only see the first 2 patches in maillist... > > The last test case seems missing? > > Maybe, the last patch is too large to post to the list? Even it get > smaller, 130260 bytes seems to be a bit large. > > How should I

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-07 Thread Jon Panozzo
And I'll throw this question out to everyone: Let's say I have a means of providing parity for a btrfs device, but in a way that's external to btrfs (imagine a btrfs single device as part of a hardware or software RAID). If BTRFS detected an error during a scrub, and parity wasn't updated as a

Re: [PATCH v2 00/25] Btrfs-convert rework to support separate chunk type

2015-12-07 Thread David Sterba
On Tue, Dec 01, 2015 at 03:11:20PM +0800, Qu Wenruo wrote: > Here comes the 2st version of btrfs-convert rework. > This time, it is rebased to co-operate with David new abstraction work > for incoming reiserfs support. > (Sorry David, your reiserfs support will need more modification as the >

Re: [PATCH 04/12] btrfs: change how delay_iput is tracked in btrfs_delalloc_work

2015-12-07 Thread David Sterba
On Fri, Dec 04, 2015 at 01:08:59PM +, Filipe Manana wrote: > On Fri, Dec 4, 2015 at 12:36 PM, David Sterba wrote: > > On Thu, Dec 03, 2015 at 06:25:37PM -0800, Liu Bo wrote: > >> > struct inode *inode; > >> > - int delay_iput; > >> > struct completion completion; >

Re: [PATCH] btrfs: Enhance super validation check

2015-12-07 Thread Qu Wenruo
On 12/07/2015 07:48 PM, Holger Hoffstätte wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/07/15 09:39, Qu Wenruo wrote: (..) +#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34) It looks like you diffed from a tree that has Josef's patch called "Btrfs: add metadump_v2 support to

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-07 Thread Austin S Hemmelgarn
On 2015-12-07 09:47, Jon Panozzo wrote: And I'll throw this question out to everyone: Let's say I have a means of providing parity for a btrfs device, but in a way that's external to btrfs (imagine a btrfs single device as part of a hardware or software RAID). If BTRFS detected an error during

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-07 Thread Jon Panozzo
This is what I was thinking as well. In my particular use-case, parity is only really used today to reconstruct an entire device due to a device failure. I think if btrfs scrub detected errors on a single device, I could do a "reverse reconstruct" where instead of syncing TO the parity disk, I

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-07 Thread Jon Panozzo
Duncan, Thanks for the additional feedback. Two follow-up questions to this is: Can the --mixed option only be applied when first creating the fs, or can you simply add this to the balance command to take an existing filesystem and add this to it? So it sounds like there are really three ways

Re: [PATCH 2/4] vfs: pull btrfs clone API to vfs layer

2015-12-07 Thread Christoph Hellwig
On Sun, Dec 06, 2015 at 04:53:31PM -0800, Darrick J. Wong wrote: > > + if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode)) > > + return -EISDIR; > > + if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode)) > > + return -EOPNOTSUPP; > > I thought we were

Re: [PATCH 1/3] btrfs-progs: test: umount if confirmation failed

2015-12-07 Thread David Sterba
On Fri, Dec 04, 2015 at 02:37:25PM +0900, Naohiro Aota wrote: > When a check in check_inode() failed, the test should umount test target > file system. This commit add clean up umount line in failure path. The lack of cleanup after failed tests is intentional (exceptions possible). The tests are

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Chandan Rajendra
On Monday 07 Dec 2015 14:06:42 Qu Wenruo wrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. > > Since the new parse_options() need to check new flags at remount time, > so add a new parameter

Re: [PATCH 2/3] btrfs-progs: properly reset nlink of multi-linked file

2015-12-07 Thread David Sterba
On Fri, Dec 04, 2015 at 02:37:26PM +0900, Naohiro Aota wrote: > If a file is linked from more than one directory and only one > of the links is corrupted, btrfs check dose not reset the nlink > properly. Actually it can go into infinite loop to link the broken file > into lost+found. > > This

Re: [PATCH V2] Btrfs: disable online scrub repair on ro cases

2015-12-07 Thread David Sterba
On Fri, Dec 04, 2015 at 09:58:04AM -0800, Liu Bo wrote: > This disables repair process on ro cases as it can cause system > to be unresponsive on the ASSERT() in repair_io_failure(). > > This can happen when scrub is running and a hardware error pops up, > we should fallback to ro mounts

Re: Scrub on btrfs single device only to detect errors, not correct them?

2015-12-07 Thread Austin S Hemmelgarn
On 2015-12-07 10:12, Jon Panozzo wrote: This is what I was thinking as well. In my particular use-case, parity is only really used today to reconstruct an entire device due to a device failure. I think if btrfs scrub detected errors on a single device, I could do a "reverse reconstruct" where

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Eric Sandeen
On 12/7/15 12:06 AM, Qu Wenruo wrote: > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > option to get real readonly mount, like "norecovery" in ext* and xfs. > > Since the new parse_options() need to check new flags at remount time, > so add a new parameter for

Re: [PATCH] btrfs: Enhance super validation check

2015-12-07 Thread David Sterba
On Mon, Dec 07, 2015 at 04:39:15PM +0800, Qu Wenruo wrote: > Enhance btrfs_check_super_valid() function by the following points: > 1) Restrict sector/node size check >Not the old max/min valid check, but also check if it's a power of 2. >So some bogus number like 12K nodesize won't pass

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Eric Sandeen
On 12/7/15 10:52 AM, Chandan Rajendra wrote: > On Monday 07 Dec 2015 10:27:05 Eric Sandeen wrote: >> On 12/7/15 12:06 AM, Qu Wenruo wrote: >>> Introduce a new mount option "nologreplay" to co-operate with "ro" mount >>> option to get real readonly mount, like "norecovery" in ext* and xfs. >>> >>>

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Chandan Rajendra
On Monday 07 Dec 2015 10:27:05 Eric Sandeen wrote: > On 12/7/15 12:06 AM, Qu Wenruo wrote: > > Introduce a new mount option "nologreplay" to co-operate with "ro" mount > > option to get real readonly mount, like "norecovery" in ext* and xfs. > > > > Since the new parse_options() need to check new

[PATCH] btrfs: Enhance super validation check

2015-12-07 Thread Qu Wenruo
Enhance btrfs_check_super_valid() function by the following points: 1) Restrict sector/node size check Not the old max/min valid check, but also check if it's a power of 2. So some bogus number like 12K nodesize won't pass now. 2) Super flag check Except some common one like WRITTEN and

Re: Fixing recursive fault and parent transid verify failed

2015-12-07 Thread Duncan
Alistair Grant posted on Mon, 07 Dec 2015 12:57:15 +1100 as excerpted: > I've ran btrfs scrub and btrfsck on the drives, with the output included > below. Based on what I've found on the web, I assume that a > btrfs-zero-log is required. > > * Is this the recommended path? [Just replying to a

Re: Fixing recursive fault and parent transid verify failed

2015-12-07 Thread Alistair Grant
On Mon, Dec 07, 2015 at 08:25:01AM +, Duncan wrote: > Alistair Grant posted on Mon, 07 Dec 2015 12:57:15 +1100 as excerpted: > > > I've ran btrfs scrub and btrfsck on the drives, with the output included > > below. Based on what I've found on the web, I assume that a > > btrfs-zero-log is

kernel 4.1.12 - hung_task_timeout

2015-12-07 Thread David Goodwin
Hi, See below for oops messages from a 4.1.12 kernel. The system would probably have been running a balance or scrub at the time. Processes trying to use subvolumes blocked and it eventually needed rebooting via sysrq to fix. Kernel is a vanilla one from kernel.org. thanks, David. INFO:

Re: [PATCH] btrfs: Enhance super validation check

2015-12-07 Thread Holger Hoffstätte
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/07/15 09:39, Qu Wenruo wrote: (..) > +#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34) It looks like you diffed from a tree that has Josef's patch called "Btrfs: add metadump_v2 support to the kernel" [1] applied, which never made it upstream

Re: [PATCH V2] Btrfs: disable online scrub repair on ro cases

2015-12-07 Thread Liu Bo
On Mon, Dec 07, 2015 at 03:37:43PM +0100, David Sterba wrote: > On Fri, Dec 04, 2015 at 09:58:04AM -0800, Liu Bo wrote: > > This disables repair process on ro cases as it can cause system > > to be unresponsive on the ASSERT() in repair_io_failure(). > > > > This can happen when scrub is running

Re: Very various speed of grep operation on btrfs partition

2015-12-07 Thread Austin S Hemmelgarn
On 2015-12-06 22:32, Duncan wrote: FWIW, I build kde without the semantic-desktop stuff even enabled at build-time (gentoo offers that option) here. All the kdepim stuff (kmail, etc) uses it, so I dumped the several kdepim related apps (kmail, akregator, kaddressbook) I used here and found

Re: [PATCH 1/3] btrfs-progs: test: umount if confirmation failed

2015-12-07 Thread Naohiro Aota
On Tue, Dec 8, 2015 at 12:33 AM, David Sterba wrote: > On Fri, Dec 04, 2015 at 02:37:25PM +0900, Naohiro Aota wrote: >> When a check in check_inode() failed, the test should umount test target >> file system. This commit add clean up umount line in failure path. > > The lack of

Re: PAX: size overflow detected in function try_merge_map fs/btrfs/extent_map.c:238

2015-12-07 Thread Tristan Mahé
Compiled the patch on 4.2.6-hardened-r8 on gentoo 64bit and it's still failing :/ [ 182.316487] PAX: size overflow detected in function try_merge_map fs/btrfs/extent_map.c:241 cicus.108_106 max, count: 13, decl: block_len; num: 0; context: extent_map; [ 182.316490] CPU: 3 PID: 11196 Comm:

Re: Fixing recursive fault and parent transid verify failed

2015-12-07 Thread Alistair Grant
On Mon, Dec 07, 2015 at 01:48:47PM +, Duncan wrote: > Alistair Grant posted on Mon, 07 Dec 2015 21:02:56 +1100 as excerpted: > > > I think I'll try the btrfs restore as a learning exercise, and to check > > the contents of my backup (I don't trust my memory, so something could > > have

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Christoph Anton Mitterer
On Mon, 2015-12-07 at 11:29 -0600, Eric Sandeen wrote: > FWIW, new mount options and their descriptions should be added to > BTRFS-MOUNT(5) > as well. Also, from the end-user perspective, there should be: 1) another option like (hard-ro) which is defined to imply any other options that are

Re: [PATCH 2/4] vfs: pull btrfs clone API to vfs layer

2015-12-07 Thread Darrick J. Wong
On Mon, Dec 07, 2015 at 04:13:19PM +0100, Christoph Hellwig wrote: > On Sun, Dec 06, 2015 at 04:53:31PM -0800, Darrick J. Wong wrote: > > > + if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode)) > > > + return -EISDIR; > > > + if (!S_ISREG(inode_in->i_mode) ||

Re: [PATCH] fstests: Fix generic/102 fail for btrfs

2015-12-07 Thread Dave Chinner
On Thu, Dec 03, 2015 at 06:08:36PM +0800, Zhaolei wrote: > From: Zhao Lei > > generic/102 sometimes fails in newest btrfs toolchain, > because it use non-mixed mode in default, which request more space > for metadata, and no space for data writing. > > This patch force

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Eric Sandeen
On 12/7/15 2:54 PM, Christoph Anton Mitterer wrote: ... > 2) a section that describes "ro" in btrfs-mount(5) which describes that > normal "ro" alone may cause changes on the device and which then refers > to hard-ro and/or the list of options (currently nologreplay) which are > required right

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Qu Wenruo
On 12/07/2015 11:38 PM, Chandan Rajendra wrote: On Monday 07 Dec 2015 14:06:42 Qu Wenruo wrote: Introduce a new mount option "nologreplay" to co-operate with "ro" mount option to get real readonly mount, like "norecovery" in ext* and xfs. Since the new parse_options() need to check new flags

Re: [PATCH] btrfs: Introduce new mount option to disable tree log replay

2015-12-07 Thread Christoph Anton Mitterer
On Mon, 2015-12-07 at 17:06 -0600, Eric Sandeen wrote: > Yeah, I don't know that this is true.  It hasn't been true for over a > decade (2?), with the most widely-used filesystem in linux history, > i.e. > ext3. Based on what? I'd now many sysadmins who don't expect that e.g. the journal is

Re: [PATCH 1/4] locks: new locks_mandatory_area calling convention

2015-12-07 Thread Al Viro
On Thu, Dec 03, 2015 at 12:59:49PM +0100, Christoph Hellwig wrote: > Pass a loff_t end for the last byte instead of the 32-bit count > parameter to allow full file clones even on 32-bit architectures. > While we're at it also drop the pointless inode argument and simplify > the read/write

Re: [PATCH v2 00/25] Btrfs-convert rework to support separate chunk type

2015-12-07 Thread Qu Wenruo
David Sterba wrote on 2015/12/07 16:20 +0100: On Tue, Dec 01, 2015 at 03:11:20PM +0800, Qu Wenruo wrote: Here comes the 2st version of btrfs-convert rework. This time, it is rebased to co-operate with David new abstraction work for incoming reiserfs support. (Sorry David, your reiserfs

Re: [PATCH 2/4] vfs: pull btrfs clone API to vfs layer

2015-12-07 Thread Darrick J. Wong
On Mon, Dec 07, 2015 at 04:13:19PM +0100, Christoph Hellwig wrote: > On Sun, Dec 06, 2015 at 04:53:31PM -0800, Darrick J. Wong wrote: > > > + if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode)) > > > + return -EISDIR; > > > + if (!S_ISREG(inode_in->i_mode) ||

Re: [PATCH 0/3] btrfs-progs: fix file restore to lost+found bug

2015-12-07 Thread Naohiro Aota
On Tue, Dec 8, 2015 at 12:35 AM, David Sterba wrote: > On Mon, Dec 07, 2015 at 11:59:19AM +0900, Naohiro Aota wrote: >> > But I only see the first 2 patches in maillist... >> > The last test case seems missing? >> >> Maybe, the last patch is too large to post to the list? Even it