Re: [PATCH] btrfs-progs: misc-tests: Primary Superblock corruption and recovery using backup Superblock.

2017-02-15 Thread Lakshmipathi.G
On Wed, Feb 15, 2017 at 09:36:03AM +0800, Qu Wenruo wrote: > > > >+# Corrupt superblock checksum > >+dd if=/dev/zero of=$TEST_DEV seek=$superblock_offset bs=1 \ > >+count=4 conv=notrunc &> /dev/null > >+run_check_stdout $SUDO_HELPER mount $TEST_DEV $TEST_MNT | \ > >+

[PATCH] btrfs: Handle btrfs_reloc_clone_csums error correctly to avoid deadlock

2017-02-15 Thread Qu Wenruo
If run btrfs/125 with nospace_cache or space_cache=v2 mount option, btrfs will block with the following backtrace: Call Trace: __schedule+0x2d4/0xae0 schedule+0x3d/0x90 btrfs_start_ordered_extent+0x160/0x200 [btrfs] ? wake_atomic_t_function+0x60/0x60 btrfs_run_ordered_extent_work+0x25/0x40

[PATCH] btrfs-progs: RAID5:Inject data stripe corruption and verify scrub fixes it.

2017-02-15 Thread Lakshmipathi.G
Signed-off-by: Lakshmipathi.G --- .../020-raid5-datastripe-corruption/test.sh| 224 + 1 file changed, 224 insertions(+) create mode 100755 tests/misc-tests/020-raid5-datastripe-corruption/test.sh diff --git

Re: FS gives kernel UPS on attempt to create snapshot and after running balance it's unmountable.

2017-02-15 Thread Qu Wenruo
At 02/15/2017 10:11 PM, Tomasz Kusmierz wrote: So guys, any help here ? I’m kinda stuck now with system just idling and doing nothing while I wait for some feedback ... Sorry for the late reply. Busying debugging a kernel bug. On 14 Feb 2017, at 19:38, Tomasz Kusmierz

Re: [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page

2017-02-15 Thread David Sterba
On Tue, Feb 14, 2017 at 11:10:32AM -0800, Liu Bo wrote: > @pnr is only used here, it can be removed, too. > > So does @max_nr. Right, thanks. Patch udpated. I've tried if this can be caught by '-Wunused-but-set-variable', strangely only max_nr is reported: fs/btrfs/extent_io.c: In function

Re: [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages

2017-02-15 Thread Liu Bo
On Wed, Feb 15, 2017 at 04:30:46PM +0100, David Sterba wrote: > On Tue, Feb 14, 2017 at 11:35:11AM -0800, Liu Bo wrote: > > On Mon, Feb 13, 2017 at 10:34:13AM +0100, David Sterba wrote: > > > The 'tree' was used to call locking hook that does not exist anymore. > > > > > > Signed-off-by: David

Re: [PATCH 04/29] btrfs: remove unused parameter from split_item

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:33AM +0100, David Sterba wrote: > Never used. > Reviewed-by: Liu Bo > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/btrfs/ctree.c

[PATCH v2] btrfs-progs: misc-tests: Superblock corruption and recovery using backup.

2017-02-15 Thread Lakshmipathi.G
Signed-off-by: Lakshmipathi.G --- .../019-fix-superblock-corruption/test.sh | 38 ++ 1 file changed, 38 insertions(+) create mode 100755 tests/misc-tests/019-fix-superblock-corruption/test.sh diff --git

Re: [PATCH 02/29] btrfs: remove unused parameter from check_async_write

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:27AM +0100, David Sterba wrote: > Added but never used. > Reviewed-by: Liu Bo > Signed-off-by: David Sterba > --- > fs/btrfs/disk-io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

[PATCH 8/7] btrfs: ulist: rename ulist_fini to ulist_release

2017-02-15 Thread David Sterba
Change the name so it matches the naming we already use eg. for btrfs_path. Suggested-by: Qu Wenruo Signed-off-by: David Sterba --- fs/btrfs/qgroup.c | 8 fs/btrfs/ulist.c | 10 +- fs/btrfs/ulist.h | 2 +- 3 files changed, 10

Re: How to dump/find parity of RAID-5 file?

2017-02-15 Thread Goffredo Baroncelli
On 2017-02-14 21:09, Lakshmipathi.G wrote: > On Mon, Feb 06, 2017 at 09:40:47PM +0100, Goffredo Baroncelli wrote: >> >> IIRC, the parity is spread across the disk stripes of the chunk. >> >> So first you have to find the logical-offset [LO] where the the file begins. >> Then you have to map this

Re: stat(2) returning device ID not existing in mountinfo

2017-02-15 Thread Goffredo Baroncelli
(Resended because I don saw it in the mailing lists) - Hi, I want to highlight this bug another time. I encountered this bug, when I was looking to a problem with find. I my machine find took an huge quantity of memory (up to 3GB) when used by updatedb.

[PATCH v2] Btrfs: fix data loss after truncate when using the no-holes feature

2017-02-15 Thread fdmanana
From: Filipe Manana If we have a file with an implicit hole (NO_HOLES feature enabled) that has an extent following the hole, delayed writes against regions of the file behind the hole happened before but were not yet flushed and then we truncate the file to a smaller size

Re: [PATCH] btrfs: Handle btrfs_reloc_clone_csums error correctly to avoid deadlock

2017-02-15 Thread Filipe Manana
On Wed, Feb 15, 2017 at 8:49 AM, Qu Wenruo wrote: > If run btrfs/125 with nospace_cache or space_cache=v2 mount option, > btrfs will block with the following backtrace: > > Call Trace: > __schedule+0x2d4/0xae0 > schedule+0x3d/0x90 >

Re: [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:30AM +0100, David Sterba wrote: > Added but never needed. Reviewed-by: Liu Bo Thanks, -liubo > > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 16 > fs/btrfs/disk-io.c | 3 +--

Re: [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:49AM +0100, David Sterba wrote: > Unused since qgroup refactoring that split data and metadata accounting, > the btrfs_qgroup_free helper. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- >

Re: [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:52AM +0100, David Sterba wrote: > Added but never used. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.h | 3 +-- > fs/btrfs/extent-tree.c | 3 +-- > fs/btrfs/transaction.c

[PATCH 2/8] btrfs: flush_space always takes fs_info->fs_root

2017-02-15 Thread jeffm
From: Jeff Mahoney We don't need to pass a root to flush_space since it always uses the fs_root. Signed-off-by: Jeff Mahoney --- fs/btrfs/extent-tree.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git

Re: [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:16AM +0100, David Sterba wrote: > Never used for anything meaningful since we have our own superblock > filler. > Looks good. Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/super.c | 5

Re: [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:29AM +0100, David Sterba wrote: > Never used. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/scrub.c | 10 +++--- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git

Re: [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:19AM +0100, David Sterba wrote: > We grab fs_info from other parameters. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/volumes.c | 10 -- > 1 file changed, 4 insertions(+), 6

Re: [PATCH v2] Btrfs: fix btrfs_decompress_buf2page()

2017-02-15 Thread Omar Sandoval
On Wed, Feb 15, 2017 at 11:32:06AM +0800, Anand Jain wrote: > Thanks Omar for nailing this down. How about a test case for this ? Yeah, I'll put together a test case using your new compressible data helper, thanks for adding that. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:45AM +0100, David Sterba wrote: > Unused since long ago. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:10AM +0100, David Sterba wrote: > Never used. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/inode.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git

Re: [PATCH 15/29] btrfs: remove unused parameter from update_nr_written

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:07AM +0100, David Sterba wrote: > The logic has been updated in "Btrfs: make mapping->writeback_index > point to the last written page" (a91326679f2a0a4c2) and page is not > needed anymore. > Reviewed-by: Liu Bo Thanks, -liubo >

[PATCH 3/8] btrfs: convert btrfs_inc_block_group_ro to accept fs_info

2017-02-15 Thread jeffm
From: Jeff Mahoney btrfs_inc_block_group_ro is either passed the extent root or the dev root, but it doesn't do anything with the dev tree. Let's convert to passing an fs_info and using the extent root. Signed-off-by: Jeff Mahoney --- fs/btrfs/ctree.h |

[PATCH 0/8] btrfs: cleanup patches

2017-02-15 Thread jeffm
From: Jeff Mahoney Hi all - Here's another around of cleanup patches. The first 7 cleanup API blemishes with unused arguments and/or root -> fs_info conversion. The last converts the pr_debug in btrfs_abort_transaction to use btrfs_debug. -Jeff Jeff Mahoney (8): btrfs:

[PATCH 1/8] btrfs: pass fs_info to (more) routines that are only called with extent_root

2017-02-15 Thread jeffm
From: Jeff Mahoney Outside of interactions with qgroups, the roots passed in extent-tree.c are usually passed to ensure that we don't do refcounts on log trees or to get the allocation profile for an allocation request. Otherwise, it operates on the extent root. This patch

[PATCH 7/8] btrfs: drop unused extent_op arg from btrfs_add_delayed_data_ref

2017-02-15 Thread jeffm
From: Jeff Mahoney btrfs_add_delayed_data_ref is always called with a NULL extent_op, so let's drop the argument. Signed-off-by: Jeff Mahoney --- fs/btrfs/delayed-ref.c | 6 ++ fs/btrfs/delayed-ref.h | 3 +-- fs/btrfs/extent-tree.c | 7 +++ 3 files

[PATCH 5/8] btrfs: btrfs_wait_cache_io_root doesn't use path argument

2017-02-15 Thread jeffm
From: Jeff Mahoney Signed-off-by: Jeff Mahoney --- fs/btrfs/free-space-cache.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 61a72fb..a1e15f6 100644 ---

[PATCH 6/8] btrfs: btrfs_truncate_free_space_cache always allocates path

2017-02-15 Thread jeffm
From: Jeff Mahoney btrfs_truncate_free_space_cache always allocates a btrfs_path structure but only uses it when the caller passes a block group. Let's move the allocation and free into the conditional. Signed-off-by: Jeff Mahoney ---

[PATCH 8/8] btrfs: use btrfs_debug instead of pr_debug in transaction abort

2017-02-15 Thread jeffm
From: Jeff Mahoney Commit e5d6b12fe14 (Btrfs: don't WARN() in btrfs_transaction_abort() for IO errors) added a pr_debug call to be printed when a transaction is aborted with -EIO instead of WARN. btrfs_debug prints which file system the message is associated with so let's use

[PATCH 4/8] btrfs: free-space-cache, clean up unnecessary root arguments

2017-02-15 Thread jeffm
From: Jeff Mahoney The free space cache APIs accept a root but always use the tree root. Also, btrfs_truncate_free_space_cache accepts a root AND an inode but the inode always points to the root anyway, so let's just pass the inode. Signed-off-by: Jeff Mahoney

Re: [PATCH 4/8] btrfs: free-space-cache, clean up unnecessary root arguments

2017-02-15 Thread Jeff Mahoney
On 2/15/17 4:28 PM, je...@suse.com wrote: > From: Jeff Mahoney > > The free space cache APIs accept a root but always use the tree root. > > Also, btrfs_truncate_free_space_cache accepts a root AND an inode but > the inode always points to the root anyway, so let's just pass the

Re: [PATCH] btrfs-progs: RAID5:Inject data stripe corruption and verify scrub fixes it.

2017-02-15 Thread Lakshmipathi.G
On Wed, Feb 15, 2017 at 05:29:33PM +0800, Qu Wenruo wrote: > > > At 02/15/2017 05:03 PM, Lakshmipathi.G wrote: > >Signed-off-by: Lakshmipathi.G > >--- > > .../020-raid5-datastripe-corruption/test.sh| 224 > > + > > 1 file changed, 224

Re: [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:42AM +0100, David Sterba wrote: > Unused since long ago. Reviewed-by: Liu Bo Thanks, -liubo > > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 12/29] btrfs: remove unused parameter from tree_move_down

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:58AM +0100, David Sterba wrote: > Never needed. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:01AM +0100, David Sterba wrote: > Not needed. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/ctree.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git

Re: [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:22AM +0100, David Sterba wrote: > The 'device' used to be added in that function, but now it's done by the > caller. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/volumes.c | 8

Re: [PATCH 5/8] btrfs: btrfs_wait_cache_io_root doesn't use path argument

2017-02-15 Thread Jeff Mahoney
On 2/15/17 4:28 PM, je...@suse.com wrote: > From: Jeff Mahoney > > Signed-off-by: Jeff Mahoney This one is obsoleted by Dave's patch: [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache -Jeff > --- > fs/btrfs/free-space-cache.c | 11

Re: [PATCH 06/29] btrfs: merge two superblock writing helpers

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:33:39AM +0100, David Sterba wrote: > write_all_supers and write_ctree_super are almost equal, the parameter > 'trans' is unused so we can drop it and have just one helper. Reviewed-by: Liu Bo Thanks, -liubo > > Signed-off-by: David Sterba

Re: [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:31AM +0100, David Sterba wrote: > Never used. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/backref.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:44AM +0100, David Sterba wrote: > bitmap_list is unused since the io_ctl framework. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/free-space-cache.c | 5 ++--- > 1 file changed, 2

Re: [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages

2017-02-15 Thread David Sterba
On Tue, Feb 14, 2017 at 11:35:11AM -0800, Liu Bo wrote: > On Mon, Feb 13, 2017 at 10:34:13AM +0100, David Sterba wrote: > > The 'tree' was used to call locking hook that does not exist anymore. > > > > Signed-off-by: David Sterba > > --- > > fs/btrfs/extent_io.c | 6 ++ > >

Re: [PATCH] btrfs: Handle btrfs_reloc_clone_csums error correctly to avoid deadlock

2017-02-15 Thread Qu Wenruo
At 02/15/2017 11:59 PM, Filipe Manana wrote: On Wed, Feb 15, 2017 at 8:49 AM, Qu Wenruo wrote: If run btrfs/125 with nospace_cache or space_cache=v2 mount option, btrfs will block with the following backtrace: Call Trace: __schedule+0x2d4/0xae0 schedule+0x3d/0x90

Re: [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:38AM +0100, David Sterba wrote: > Never used. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/ioctl.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:50AM +0100, David Sterba wrote: > Never used. > Looks good. Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/qgroup.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref

2017-02-15 Thread Liu Bo
On Mon, Feb 13, 2017 at 10:34:41AM +0100, David Sterba wrote: > Unused since the helper has been split, eb used in the caller. > Reviewed-by: Liu Bo Thanks, -liubo > Signed-off-by: David Sterba > --- > fs/btrfs/tree-log.c | 3 +-- > 1 file changed, 1

Re: FS gives kernel UPS on attempt to create snapshot and after running balance it's unmountable.

2017-02-15 Thread Tomasz Kusmierz
So guys, any help here ? I’m kinda stuck now with system just idling and doing nothing while I wait for some feedback ... > On 14 Feb 2017, at 19:38, Tomasz Kusmierz wrote: > > [root@server ~]# btrfs-show-super -af /dev/sdc > superblock: bytenr=65536, device=/dev/sdc >