Chandan Rajendra | 24 Apr 20:20 2015
Picon

[PATCH] Btrfs: Add OPER_SUB_SUBTREE to the list of operation types to be displayed in a trace.

BTRFS_QGROUP_OPER_SUB_SUBTREE is missing from the list of operation types that
will be displayed in a trace. Fix this.

Signed-off-by: Chandan Rajendra <chandan <at> linux.vnet.ibm.com>
---
 include/trace/events/btrfs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 1faecea..7a51ec3 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
 <at>  <at>  -1122,7 +1122,8  <at>  <at>  DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy,
 		{ BTRFS_QGROUP_OPER_ADD_EXCL, 	"OPER_ADD_EXCL" },	\
 		{ BTRFS_QGROUP_OPER_ADD_SHARED, "OPER_ADD_SHARED" },	\
 		{ BTRFS_QGROUP_OPER_SUB_EXCL, 	"OPER_SUB_EXCL" },	\
-		{ BTRFS_QGROUP_OPER_SUB_SHARED,	"OPER_SUB_SHARED" })
+		{ BTRFS_QGROUP_OPER_SUB_SHARED,	"OPER_SUB_SHARED" },	\
+		{ BTRFS_QGROUP_OPER_SUB_SUBTREE,"OPER_SUB_SUBTREE" })

 DECLARE_EVENT_CLASS(btrfs_qgroup_oper,

--

-- 
2.1.0

--
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

(Continue reading)

arnaud gaboury | 24 Apr 19:22 2015
Picon

installation of a nspwan-container on btrfs subvolumes

Archlinux host

1- created 3 btrfs subvol on /dev/sdb1 (SSD). The goal is to manage
snapshots easily.
no nested subvol.
------------------------------------------
# btrfs subvolume list .
ID 266 gen 39 top level 5 path rootvol
ID 268 gen 41 top level 5 path var
ID 269 gen 42 top level 5 path etc
----------------------------------------------------

2 - mount btrfs subvol
-------------------------------------------------------------------
# mount -t btrfs -o subvol=rootvol /dev/sdb1 /var/lib/machines/poppy
# mkdir /var/lib/machines/poppy/var
# mkdir /var/lib/machines/poppy/etc
# mount -t btrfs -o subvol=etc /dev/sdb1 /var/lib/machines/poppy/etc
# mount -t btrfs -o subvol=var /dev/sdb1 /var/lib/machines/poppy/var
--------------------------------------------------------------------

3- installed Fedora on /var/lib/machines/poppy

4- when booting the container, it hangs.

weird:
-------------------------------------------------------------------------------
root <at> hortensia ➤➤ lib/machines # ls poppy/etc
lvm/    systemd/  group    ld.so.cache  machine-id     os-release <at>   resolv.conf
pam.d/  udev/     gshadow  localtime <at>    nsswitch.conf  passwd       shadow
(Continue reading)

David Sterba | 24 Apr 19:11 2015
Picon

[PATCH 0/3] Better transaction abort reports

Hi,

patch #1 moves the WARN at transaction abort time to the callsite (via macro).
That way we get the exact location of the error and not the common location.
This is supposed to help debugging and screening report, but the change comes
at some cost and increases the resulting asm code.

I vote for better error reports, the .text grows all the time anyway. Patch #2
adds some compiler hints so the error blocks are likely to be put out of the
hot paths.

Available in

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git dev/abort-onsite

David Sterba (3):
  btrfs: report exact callsite where transaction abort occurs
  btrfs: add 'cold' compiler annotations to all error handling functions
  btrfs: fix warnings after changes in btrfs_abort_transaction

 fs/btrfs/ctree.h   | 16 +++++++++++++---
 fs/btrfs/ioctl.c   |  2 +-
 fs/btrfs/super.c   | 11 +++--------
 fs/btrfs/volumes.c |  6 +++---
 4 files changed, 20 insertions(+), 15 deletions(-)

--

-- 
2.1.3

--
(Continue reading)

Lentes, Bernd | 24 Apr 16:26 2015
Picon

rollback of a snapshot is just read-only

Hi,

it should be just a small problem, but it is one. How can I rollback to a snapshot of my root filesystem ?
Googeling, I found a lot of solutions, each different.
I finally choosed this one: https://btrfs.wiki.kernel.org/index.php/UseCases#I_want_to_be_able_to_do_rollbacks_with_Btrfs

I made the snapshot, changed some configuration, and afterwards I'd like to rollback to the snapshot:

- btrfs subvolume snapshot -r  /  /.snapshots/vor_nvidia

- change some configuration

- btrfs subvolume set-default 625 (id of the snapshot)

- reboot

My /-folder is again the old one, that's ok. The change of the configuration has disappeared. But it is just read-only:
pc63422:~ # touch /test
touch: cannot touch '/test': Read-only file system

mount says:

...
/dev/sda1 on /  type btrfs (rw,ssd,space_cache)
...

It seems to be rw !?

OS: SLES 12 64bit
kernel: 3.12.38-44-default
(Continue reading)

David Sterba | 24 Apr 16:44 2015
Picon

[PATCH] btrfs: let tree defrag work in SSD mode

Long time ago (2008) the defrag was automatic for new b-tree writes but
has been disabled after performance problems. There was a leftover in
tree-defrag.c that effectively stops any defragmentation on b-trees.
This is a bit unexpected and IMHO undesired. The SSD mode is an
optimization and defrag is supposed to work if the users asks for it.

Related commits:

6702ed490ca0bb44e17131818a5a18b773957c5a
Btrfs: Add run time btree defrag, and an ioctl to force btree defrag

e18e4809b10e6c9efb5fe10c1ddcb4ebb690d517
Btrfs: Add mount -o ssd, which includes optimizations for seek free
storage

b3236e68bf86b3ae87f58984a1822369225211cb
Btrfs: Leave on the tree defragger in mount -o ssd, it still helps there

9afbb0b752ef30a429c45b9de6706e28ad1a36e1
Btrfs: Disable tree defrag in SSD mode

The last three commits switch the defrag+ssd off/on/off and the last one

3f157a2fd2ad731e1ed9964fecdc5f459f04a4a4
Btrfs: Online btree defragmentation fixes

misses the bits from tree-defrag.c to revert to the behaviour introduced
in e18e4809b10e.

Signed-off-by: David Sterba <dsterba <at> suse.cz>
(Continue reading)

Lentes, Bernd | 24 Apr 16:08 2015
Picon

rollback of a snapshot is just read-only

Hi,

it should be just a small problem, but it is one. How can I rollback to a snapshot of my root filesystem ?
Googeling, I found a lot of solutions, each different.
I finally choosed this one: https://btrfs.wiki.kernel.org/index.php/UseCases#I_want_to_be_able_to_do_rollbacks_with_Btrfs

I made the snapshot, changed some configuration, and afterwards I'd like to rollback to the snapshot:

- btrfs subvolume snapshot -r  /  /.snapshots/vor_nvidia

- change some configuration

- btrfs subvolume set-default 625 (id of the snapshot)

- reboot

My /-folder is again the old one, that's ok. The change of the configuration has disappeared. But it is just read-only:
pc63422:~ # touch /test
touch: cannot touch '/test': Read-only file system

mount says:

...
/dev/sda1 on /  type btrfs (rw,ssd,space_cache)
...

It seems to be rw !?

OS: SLES 12 64bit
kernel: 3.12.38-44-default
(Continue reading)

George Wang | 24 Apr 14:08 2015
Picon

btrfs/078 may got stuck in the __wait_on_atomic_t

Hi, I got stuck by btrfs/078 with 1 cpu(2 core) machine. And I notice
this patch maybe the
root cause of it.

commit cb65537ee1134d3cc55c1fa83952bc8eb1212833
Author: David Howells <dhowells <at> redhat.com>
Date:   Fri May 10 19:50:26 2013 +0100

    Add wait_on_atomic_t() and wake_up_atomic_t()
<snip>
+/*
+ * To allow interruptible waiting and asynchronous (i.e. nonblocking) waiting,
+ * the actions of __wait_on_atomic_t() are permitted return codes.  Nonzero
+ * return codes halt waiting and return.
+ */
+static __sched
+int __wait_on_atomic_t(wait_queue_head_t *wq, struct wait_bit_queue *q,
+                      int (*action)(atomic_t *), unsigned mode)
+{
+       atomic_t *val;
+       int ret = 0;
+
+       do {
+               prepare_to_wait(wq, &q->wait, mode);
+               val = q->key.flags;
+               if (atomic_read(val) == 0)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^here,
is this judge ok? if the val not 0,

the most thing we want to do is schedule.
(Continue reading)

sri | 24 Apr 09:41 2015
Picon

btrfs send dump format

Hi,

Is there any document or something to understand btrfs send format/layout 
i.e being created when we give a file with -f option. 

I looking for it in order to create similar dump file with same layout so 
that I can use btrfs receive with the dump file which I have created in 
order to receive files form dump.

--
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 | 24 Apr 03:12 2015

[PATCH v2 1/2] btrfs: Fix superblock csum type check.

Old csum type check is wrong and can't catch csum_type 1(not supported).

Fix it to avoid hostile 0 division.

Reported-by: Lukas Lueg <lukas.lueg <at> gmail.com>
Signed-off-by: Qu Wenruo <quwenruo <at> cn.fujitsu.com>
---
Changelog:
v2:
   Fix existing codes other than adding new one.
---
 fs/btrfs/ctree.h   | 1 +
 fs/btrfs/disk-io.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index f9c89ca..d6f3aa0 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
 <at>  <at>  -173,6 +173,7  <at>  <at>  struct btrfs_ordered_sum;

 /* csum types */
 #define BTRFS_CSUM_TYPE_CRC32	0
+#define BTRFS_CSUM_LAST_TYPE	0

 static int btrfs_csum_sizes[] = { 4, 0 };

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 639f266..e33a01b 100644
--- a/fs/btrfs/disk-io.c
(Continue reading)

Lukas Lueg | 24 Apr 00:22 2015
Picon

Crafted btrfs-image causes access to unallocated memory in btrfs_search_slot(), check_block() and others

See also https://bugzilla.kernel.org/show_bug.cgi?id=97191

Running btrfs-progs v3.19.1

The btrfs-image attached to this bug causes the btrfs-userland tool to
overflow some data structures, leading to unallocated memory being
written to and read from. A segfault results shortly after. Reproduced
on x86-64 and i686.

The kernel seems to be less affected and fails to mount the image. I
didn't investigate whether the reads/writes could be used to gain
control over $EIP. Since the first invalid write of 8 bytes seems to
run into adjacent heap blocks (crash in unlink()), it may be possible
though.

gdb output:

Program received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av <at> entry=0x32629b7cc0 <main_arena>) at malloc.c:4151
4151    unlink(av, p, bck, fwd);
(gdb) bt
#0  malloc_consolidate (av=av <at> entry=0x32629b7cc0 <main_arena>) at malloc.c:4151
#1  0x0000003262680628 in _int_malloc (av=av <at> entry=0x32629b7cc0
<main_arena>, bytes=bytes <at> entry=4224) at malloc.c:3420
#2  0x000000326268315e in __GI___libc_malloc (bytes=4224) at malloc.c:2896
#3  0x0000000000449d15 in __alloc_extent_buffer (tree=0x88c078,
bytenr=4288512, blocksize=4096) at extent_io.c:541
#4  0x000000000044a8b4 in alloc_extent_buffer (tree=0x88c078,
bytenr=4288512, blocksize=4096) at extent_io.c:648
#5  0x000000000043b1a0 in btrfs_find_create_tree_block
(Continue reading)

Mark Fasheh | 23 Apr 23:12 2015
Picon

[PATCH][RFC] btrfs-progs: add 'du' command

Hi,

This patch adds a 'du' subcommand to btrfs. 'btrfs fi du' will
calculate disk usage of the target files using fiemap. For individual
files, it will report a count of total bytes, and exclusive (not
shared) bytes. We also calculate a 'set shared' value which is
described below.

Each argument to 'btrfs fi du' will have a 'set shared' value
calculated for it. We define each 'set' as those files found by a
recursive search of an argument to btrfs fi du. The 'set shared' value
then is a sum of all shared space referenced by the set.

'set shared' takes into account overlapping shared extents, hence it
isn't as simple as adding up shared extents. To efficiently find
overlapping regions, we store them in an interval tree. When the scan
of a file set is complete, we can walk the tree and calculate our
actual shared bytes while also taking into account any duplicate or
overlapping extents.

The interval tree implementation is taken from Linux v4.0-rc7. I went
ahead and made some small comment updates to rbtree.h and
rbtree_augmented.h while I was importing this code as both are used by
the interval tree and I needed to check for any code changes in those
headers (there weren't any).

Following this paragraph is a very simple example. I started with a
clean btrfs fs in which i copied vmlinuz from /boot. I then made a
snapshot of the fs root in 'snap1'. After the snapshot, I made a 2nd
copy of vmlinuz into the main fs to give us some not-shared data. The
(Continue reading)


Gmane