Vytautas D | 30 Jan 17:41 2015
Picon

rolling back to ext4 doesn't work if rebalanced

Is it possible to automate btrfs-convert so that it would defrag and
balance the disk without loosing ability to roll back to ext4
partition ?

i.e:
btrfs-convert /dev/sda3
# I can still rollback using btrfs-convert -r /dev/sda3

btrfs filesystem defrag -r /
# I can still rollback using btrfs-convert -r /dev/sda3

btrfs balance start /
# I can no longer rollback to ext4

-Vytas

P.S.
btrfs version
Btrfs v3.17
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Forrest Liu | 30 Jan 12:42 2015

[PATCH] Btrfs: add missing blk_finish_plug in btrfs_sync_log()

Add missing blk_finish_plug in btrfs_sync_log()

Signed-off-by: Forrest Liu <forrestl <at> synology.com>
---
 fs/btrfs/tree-log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index a266587..06f0283 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
 <at>  <at>  -2623,6 +2623,7  <at>  <at>  int btrfs_sync_log(struct btrfs_trans_handle *trans,
 	}

 	if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) {
+		blk_finish_plug(&plug);
 		mutex_unlock(&log_root_tree->log_mutex);
 		ret = root_log_ctx.log_ret;
 		goto out;
--

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Qu Wenruo | 30 Jan 10:20 2015

[PATCH v5 0/9] btrfs: Fix freeze/sysfs deadlock in better method.

Patchset to solve the previous found freeze/sysfs deadlock.

Unlike previous pending_changes, which uses transaction commits to
ensure mount option doesn't change during transaction.
This idea is great in concept, but will introduce extra and somewhat
duplicated ro/freeze check, and the original synchronized behavior is
also changed.

[Per-transaction mount option]
This patch use the RCU-like concept, which will copy the mount_opt from
fs_info into btrfs_transaction, and each btrfs_test_opt() for specific
mount option bit(SPACE_CACHE/INODE_MAP_CACHE) should be changed to
btrfs_test_trans_opt().
So mount option during transaction won't be changed, and also, no extra
read_only or freeze check is needed, the commit routine is also
untouched.

[Use VFS protect for sysfs change]
The 6th patch will introduce a new help function sb_want_write() to
claim write permission to a superblock.
With this, we are able to do write protection like mnt_want_write() but
only needs to ensure that the superblock is writeable.
This also keeps the same synchronized behavior using ioctl, which will
block on frozen fs until it is unfrozen.

Changelog:
v1:
   Only use cheap freeze check to avoid deadlock.
v2:
   Fix the never changed pending_changes bug and handle transaction in
(Continue reading)

Steven Schlansker | 29 Jan 23:50 2015

Re: Indefinite hang in reserve_metadata_bytes on kernel 3.18.3

Hi Holger,

On Jan 29, 2015, at 2:08 AM, Holger Hoffstätte <holger.hoffstaette <at> googlemail.com> wrote:

> [This mail was also posted to gmane.comp.file-systems.btrfs.]
> 
> On Thu, 29 Jan 2015 01:44:02 +0000, Steven Schlansker wrote:
> 
> [..snip..]
> 
>> The symptoms are an endlessly increasing stream of hung tasks and high
> 
> Please try 3.18.5 (-rc1 is good) which contains the following fix:
> 
> "workqueue: fix subtle pool management issue which can stall whole
> worker_pool"
> 
> see: http://article.gmane.org/gmane.linux.kernel.stable/122074
> 
> No promises but it seems sufficiently causally related..

Thank you for the suggestion.  I did not find a 3.18.5 presented in any form other than as a large number of
*.patch files, so I went for 3.19-rc6 instead (which I verified has this commit)

Now I am getting:

[ 1224.728313] ------------[ cut here ]------------
[ 1224.728323] kernel BUG at fs/btrfs/extent-tree.c:7362!
[ 1224.728327] invalid opcode: 0000 [#1] SMP 
[ 1224.728331] Modules linked in: dm_multipath(E) scsi_dh(E) x86_pkg_temp_thermal(E) coretemp(E)
(Continue reading)

Filipe Manana | 29 Jan 20:18 2015

[PATCH] Btrfs: fix race between transaction commit and empty block group removal

Committing a transaction can race with automatic removal of empty block
groups (cleaner kthread), leading to a BUG_ON() in the transaction
commit code while running btrfs_finish_extent_commit(). The following
sequence diagram shows how it can happen:

           CPU 1                                       CPU 2

btrfs_commit_transaction()
  fs_info->running_transaction = NULL
  btrfs_finish_extent_commit()
    find_first_extent_bit()
      -> found range for block group X
         in fs_info->freed_extents[]

                                               btrfs_delete_unused_bgs()
                                                 -> found block group X

                                                 Removed block group X's range
                                                 from fs_info->freed_extents[]

                                                 btrfs_remove_chunk()
                                                    btrfs_remove_block_group(bg X)

    unpin_extent_range(bg X range)
       btrfs_lookup_block_group(bg X)
          -> returns NULL
            -> BUG_ON()

The trace that results from the BUG_ON() is:

(Continue reading)

Qu Wenruo | 29 Jan 10:07 2015

[PATCH v3 00/10] Enhance btrfs-find-root and open_ctree() to provide better chance on damaged btrfs.

The patchset first enhance btrfs-find-root command and then use it to
enhance open_ctree to provide a better chance to open heavily damaged
btrfs.

Patch 1~9 are all enhancement/cleanup for btrfs-find-root in the following
concepts.
1) Reuse existing infrastructure.
Use existing or slightly modified infrastructure other than
copy-n-modify codes.

2) Enhanced root search logic
The old root search logic have many problems, like ignore newer root
with smaller level and use wrong generation/level for searching.

The new logic will keep a per-generation record to deal the tree search,
and use different level/generation for different tree.

3) Make the find-root infrastructure exported to other commands.
Allow other btrfs-progs components to use find-root infrastructure, e.g.
open_ctree can use it if all primary/backup tree roots are corrupted.

Patch 10 is enhancement for open_ctree to use find-root infrastructure.

Also, since only 2 patches is modified(although other part is slightly
modified to match the change), to avoid mail bombing, I created the pull
request on github and only send the first 2 patches with cover-letter.
https://github.com/kdave/btrfs-progs/pull/5

---
changelog:
(Continue reading)

Qu Wenruo | 29 Jan 03:24 2015

[PATCH RESEND v4 0/8] Fix freeze/sysfs deadlock in better method.

Patchset to solve the previous found freeze/sysfs deadlock.

Unlike previous pending_changes, which uses transaction commits to
ensure mount option doesn't change during transaction.
This idea is great in concept, but will introduce extra and somewhat
duplicated ro/freeze check, and the original synchronized behavior is
also changed.

[Per-transaction mount option]
This patch use the RCU-like concept, which will copy the mount_opt from
fs_info into btrfs_transaction, and each btrfs_test_opt() for specific
mount option bit(SPACE_CACHE/INODE_MAP_CACHE) should be changed to
btrfs_test_trans_opt().
So mount option during transaction won't be changed, and also, no extra
read_only or freeze check is needed, the commit routine is also
untouched.

[Use VFS protect for sysfs change]
The 6th patch will introduce a new help function get_vfsmount_sb() to
get a vfsmount from a sb, with this vfsmount, we can use vfs level
mnt_want_write() to do a comprehensive protection other than the cheap
ro/freeze check.

Changelog:
v1:
   Only use cheap freeze check to avoid deadlock.
v2:
   Fix the never changed pending_changes bug and handle transaction in
   btrfs_freeze()
v3:
(Continue reading)

Steven Schlansker | 29 Jan 02:44 2015

Indefinite hang in reserve_metadata_bytes on kernel 3.18.3

[ Please CC me on responses, I am not subscribed to the list ]

Hello linux-btrfs,

I am running an cluster of Docker containers managed by Apache Mesos.  Until recently, we'd found btrfs to be
the most reliable storage backend for Docker.  But now we are having troubles where large numbers of our
slave nodes go offline due to processes hanging indefinitely inside of btrfs.

We were initially running Ubuntu kernel 3.13.0-44, but had serious troubles, so I moved to 3.18.3 to
preemptively address the "You should run a recent vanilla kernel" response I expected from this mailing
list :)

The symptoms are an endlessly increasing stream of hung tasks and high load average.  The first process (a
Mesos slave task) to hang is stuck here, according to /proc/*/stack:

[<ffffffffa004333a>] reserve_metadata_bytes+0xca/0x4c0 [btrfs]
[<ffffffffa00443c9>] btrfs_delalloc_reserve_metadata+0x149/0x490 [btrfs]
[<ffffffffa006dbe2>] __btrfs_buffered_write+0x162/0x590 [btrfs]
[<ffffffffa006e297>] btrfs_file_write_iter+0x287/0x4e0 [btrfs]
[<ffffffff811dc6f1>] new_sync_write+0x81/0xb0
[<ffffffff811dd017>] vfs_write+0xb7/0x1f0
[<ffffffff811dda96>] SyS_write+0x46/0xb0
[<ffffffff8187842d>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff

A further attempt to access btrfs ( ls -Rl /mnt ) hangs here:

[<ffffffffa004333a>] reserve_metadata_bytes+0xca/0x4c0 [btrfs]
[<ffffffffa0043cc0>] btrfs_block_rsv_add+0x30/0x60 [btrfs]
[<ffffffffa005c1ba>] start_transaction+0x45a/0x5a0 [btrfs]
(Continue reading)

Xing Gu | 29 Jan 01:46 2015

[PATCH v6] btrfs: add regression test for remount with thread_pool resized

Regression test for a btrfs issue of resizing 'thread_pool' when
remount the fs.

This regression was introduced by the following linux kernel commit:
    btrfs: Added btrfs_workqueue_struct implemented ordered
    execution based on kernel workqueue
    08a9ff3264181986d1d692a4e6fce3669700c9f8
And it was fixed by the following linux kernel commit:
    btrfs: fix crash in remount(thread_pool=) case
    800ee2247f483b6d05ed47ef3bbc90b56451746c

Signed-off-by: Xing Gu <gux.fnst <at> cn.fujitsu.com>
---
 v5->v6: Add a filter to wipe "Performing full device TRIM" and
         "Turning ON incompat feature" in common/filter:_filter_mkfs.

 v4->v5: Redirect stderr to /dev/null.

 v3->v4: Remove the check for a bug message.

 v2->v3: Add the regresssion commit in description.
         Remove "dmesg -c > /dev/null".
         Echo "Silence is golden" to indicate that an empty output
         file is expected.

 v1->v2: Add the fix commit in description.
         Add the check for a bug message.
---
 common/filter       |  4 ++++
 tests/btrfs/082     | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
(Continue reading)

Qu Wenruo | 29 Jan 02:27 2015

[PATCH v4 0/8] Fix freeze/sysfs deadlock in better method.

Patchset to solve the previous found freeze/sysfs deadlock.

Unlike previous pending_changes, which uses transaction commits to
ensure mount option doesn't change during transaction.
This idea is great in concept, but will introduce extra and somewhat
duplicated ro/freeze check, and the original synchronized behavior is
also changed.

[Per-transaction mount option]
This patch use the RCU-like concept, which will copy the mount_opt from
fs_info into btrfs_transaction, and each btrfs_test_opt() for specific
mount option bit(SPACE_CACHE/INODE_MAP_CACHE) should be changed to
btrfs_test_trans_opt().
So mount option during transaction won't be changed, and also, no extra
read_only or freeze check is needed, the commit routine is also
untouched.

[Use VFS protect for sysfs change]
The 6th patch will introduce a new help function get_vfsmount_sb() to
get a vfsmount from a sb, with this vfsmount, we can use vfs level
mnt_want_write() to do a comprehensive protection other than the cheap
ro/freeze check.

Qu Wenruo (8):
  Revert "btrfs: add support for processing pending changes" related    
    commits
  btrfs: Make btrfs_parse_options() parse mount option in a atomic way
  btrfs: Introduce per-transaction mount_opt to keep mount option    
    consistent during transaction.
  btrfs: Use btrfs_test_trans_opt() to handle SPACE_CACHE if it's under 
(Continue reading)

Pavel Volkov | 28 Jan 18:04 2015

Linux documentation: btrfs.txt

In my 3.18.3 sources the file at Documentation/filesystems/btrfs.txt says:

"Btrfs is under heavy development, and is not suitable for
any uses other than benchmarking and review. The Btrfs disk format is
not yet finalized."

btrfs is no longer marked experimental in kernel and the file format is 
stable. It is suited for general use except some features.
Maybe it's time to update btrfs.txt?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane