Hello community,

here is the log from the commit of package btrfsprogs.2295 for 
openSUSE:12.3:Update checked in at 2013-12-04 12:58:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/btrfsprogs.2295 (Old)
 and      /work/SRC/openSUSE:12.3:Update/.btrfsprogs.2295.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "btrfsprogs.2295"

Changes:
--------
New Changes file:

--- /dev/null   2013-11-25 01:44:08.036031256 +0100
+++ /work/SRC/openSUSE:12.3:Update/.btrfsprogs.2295.new/btrfsprogs.changes      
2013-12-04 12:58:50.000000000 +0100
@@ -0,0 +1,250 @@
+-------------------------------------------------------------------
+Tue Nov 26 18:13:57 CET 2013 - [email protected]
+
+- update to version 3.12 (bnc#813231)
+  - update tarball and remove upstreamed patches
+  - remove stale btrfs-dev-clear-sb utility
+- mkfs:
+  - extrefs (aka. hardlink limitation) feature is set by default
+  - fs options can be specified via -O option
+- fsck, btrfs-image: various improvements and fixes
+- restore:
+  - recover extended attributes
+  - able to sanitize filenames and xattrs
+- fi df: size units are printed in powers of two
+- fi defrag: -r recursively processes directories
+- qgroup show: improved output
+- subvol list: able to show deleted subvolumes
+- new subcommand rescue for last-resort rescue operations
+  - chunk tree recovery
+  - super block recovery
+- btrfs-calc-size prints more stats
+- more manpages, help text updates
+- device detection uses blkid cache
+- code passed through static checkers
+- build libbtrfs
+- other people's changes pulled from factory package
+  - do not package obsolete utilities
+  - set correct file mode if writing replacement fsck
+  - initrd support: add module (bnc#750185, bnc#727383)
+  - Simplify checks in mkinitrd scripts.
+- Added patches:
+  - 0162-btrfs-progs-fix-loop-device-mount-checks.patch
+  - 0163-btrfs-progs-fsck-fix-segfault.patch
+  - 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch
+  - 0165-Revert-btrfs-progs-update-options-in-find-root.c.patch
+  - 0166-Btrfs-progs-add-some-verbose-output-to-find-root.patch
+  - 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch
+  - 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch
+  - 0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch
+  - 0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch
+
+-------------------------------------------------------------------
+Fri Mar  9 16:26:20 UTC 2012 - [email protected]
+
+- place binaries in /usr tree (UsrMerge project)
+- adjust mkinitrd scrippt accordingly
+
+-------------------------------------------------------------------
+Mon Mar  5 13:06:43 CET 2012 - [email protected]
+
+- add btrfsck repair options for:
+  - rebuild extent records
+  - fix block group accounting
+  - reset csums for rescue nodatasum mount
+  - prune corrupt extent allocation tree blocks
+- device scanning fixes for dm and multipath
+- initrd support: move btrfs device scan after block device setup
+- documentation updates
+- add csize for file commpressed size
+- updated restore utility
+
+-------------------------------------------------------------------
+Mon Feb 13 10:44:43 UTC 2012 - [email protected]
+
+- patch license to follow spdx.org standard
+
+-------------------------------------------------------------------
+Mon Dec 12 15:44:48 CET 2011 - [email protected]
+
+- btrfs-progs-fix-open_ctree_usage_segfaults.patch: fix
+  segfaults from bnc#710486 due to unchecked usage of return
+  value of open_ctree()
+  [fixed compilation warnings]
+
+-------------------------------------------------------------------
+Mon Dec 12 14:50:07 CET 2011 - [email protected]
+
+- pull upstream, replace existing patches, spec update
+- update 'restore' utility
+  - lzo support
+  - tools may now take earlies superblock when opening the fs
+  - other fixes
+- pull integration-20111030 branch
+  - mkfs: force mkfs if desired
+  - other fixes
+- add btrfs-dump-super to mkinitrd
+- other fixes
+  - skip non-existent devices or without media
+  - documentation updates
+  - scrubbing single device
+  - graceful error handling when opening fs fails
+
+-------------------------------------------------------------------
+Fri Dec  9 00:43:08 CET 2011 - [email protected]
+
+- updated mkinitrd script to scan devices before mount (bnc#727383)
+
+-------------------------------------------------------------------
+
+Wed Nov  9 14:34:56 CET 2011 - [email protected]
+
+- add several tools to mkinitrd if root fs is btrfs
+- pull upstream branch and delete local patches
+
+-------------------------------------------------------------------
+Tue Oct  4 02:08:54 CEST 2011 - [email protected]
+
+- btrfsck: ignore -a (bnc#655906)
+- btrfsck: fix strerror value
+
+-------------------------------------------------------------------
+Sat Sep 17 20:58:20 UTC 2011 - [email protected]
+
+- Remove redundant tags/sections from specfile
+- Use %_smp_mflags for parallel build
+
+-------------------------------------------------------------------
+Thu Aug  4 21:52:12 CEST 2011 - [email protected]
+
+- add patch for local version override as we do not build from
+  git, and avoid doubled "Btrfs" in output of 'btrfs'
+
+-------------------------------------------------------------------
+Thu Aug  4 21:20:11 CEST 2011 - [email protected]
+
+- reorder help for 'get-default' right after 'set-default'
+
+-------------------------------------------------------------------
+Thu Jul 28 19:10:08 CEST 2011 - [email protected]
+
+- add option -p to print parent subvolume
+- add subvolume 'get-default' subsubcommand
+
+-------------------------------------------------------------------
+Wed Jul 20 19:12:46 CEST 2011 - [email protected]
+
+- remove debugging printf from
+  0001-Btrfs-progs-add-a-btrfs-select-super-command-to-over.patch
+
+-------------------------------------------------------------------
+Fri Jul  1 16:59:41 CEST 2011 - [email protected]
+
+- add support for currently available kernel features:
+  - add scrub subcommand
+  - scan /proc/partitions by default (or use --all-devices for all)
+  - mkfs fixes and improvements
+  - documentation fixes
+
+-------------------------------------------------------------------
+Fri Jul  1 16:31:44 CEST 2011 - [email protected]
+
+- fix failing on deleted loop mounts (bnc#697671)
+
+-------------------------------------------------------------------
+Fri Jul  1 15:54:23 CEST 2011 - [email protected]
+
+- update from git:
+  - add btrfs-select-super utility
+  - add btrfs-label utility
+  - allow mixed data+metadata (option --mixed)
+  - allow populating new filesystem with files (option --rootdir)
+  - allow discard support in mkfs
+  - lzo support
+  - deprecate 'btrfsctl' 'btrfs-vol' 'btrfs-show'
+  - other bugfixes and documentation improvements
+
+-------------------------------------------------------------------
+Mon Mar 21 13:01:23 CET 2011 - [email protected]
+
+- change to a hardlink
+
+-------------------------------------------------------------------
+Mon Mar 14 19:19:34 CET 2011 - [email protected]
+
+- add link for fsck.btrfs (bnc#665899)
+
+-------------------------------------------------------------------
+Thu Dec 16 20:53:19 CET 2010 - [email protected]
+
+- update to v0.19-35-g1b444cd:
+  * used space accounting fix for the converter
+  * Add btrfs-list for listing subvolumes
+  * Add new util: 'btrfs' 
+  * multidevice support for check_mounted
+  * check slash in deleting subvolumes
+  * Add btrfsck option to select the super block copy
+  * btrfs-debug-tree: add -d option to print only the device mapping
+
+-------------------------------------------------------------------
+Wed May 26 17:00:46 CEST 2010 - [email protected]
+
+- fix crash on creating filesystems (bnc#603620)
+
+-------------------------------------------------------------------
+Fri May  7 15:05:11 CEST 2010 - [email protected]
+
+- revert last change (bnc#599224#c3)
++++ 53 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.3:Update/.btrfsprogs.2295.new/btrfsprogs.changes

New:
----
  0162-btrfs-progs-fix-loop-device-mount-checks.patch
  0163-btrfs-progs-fsck-fix-segfault.patch
  0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch
  0165-Revert-btrfs-progs-update-options-in-find-root.c.patch
  0166-Btrfs-progs-add-some-verbose-output-to-find-root.patch
  0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch
  0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch
  0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch
  0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch
  boot-btrfs.sh
  btrfs-progs-v3.12.tar.bz2
  btrfsprogs.changes
  btrfsprogs.spec
  local-version-override.patch
  mkfs-default-4k-nodes.diff
  setup-btrfs.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ btrfsprogs.spec ++++++
#
# spec file for package btrfsprogs
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           btrfsprogs
Url:            http://btrfs.wiki.kernel.org/index.php/Main_Page
Version:        3.12
Release:        0
%define tar_version v3.12
Summary:        Utilities for the Btrfs filesystem
License:        GPL-2.0
Group:          System/Filesystems
#Git-Web:       
http://git.kernel.org/cgit/linux/kernel/git/mason/btrfs-progs.git
#Git-Clone:     git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs
Source:         btrfs-progs-%{tar_version}.tar.bz2
Source1:        boot-btrfs.sh
Source4:        setup-btrfs.sh

Patch162:       0162-btrfs-progs-fix-loop-device-mount-checks.patch
Patch163:       0163-btrfs-progs-fsck-fix-segfault.patch
Patch164:       0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch
Patch165:       0165-Revert-btrfs-progs-update-options-in-find-root.c.patch
Patch166:       0166-Btrfs-progs-add-some-verbose-output-to-find-root.patch
Patch167:       0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch
Patch168:       0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch
Patch169:       0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch
Patch170:       0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch

Patch1000:      local-version-override.patch
Patch1001:      mkfs-default-4k-nodes.diff

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libacl-devel
BuildRequires:  libattr-devel
BuildRequires:  libblkid-devel
BuildRequires:  libext2fs-devel
BuildRequires:  libuuid-devel
BuildRequires:  lzo-devel
BuildRequires:  zlib-devel
# for /bin/true
Requires:       coreutils
Supplements:    filesystem(btrfs)

%description
Utilities needed to create and maintain btrfs file systems under Linux.

%package -n libbtrfs0
Summary:        Library for interacting with Btrfs
Group:          System/Libraries

%description -n libbtrfs0
This package contains the libbtrfs.so shared library needed for some
applications to interface with btrfs.

%package -n libbtrfs-devel
Summary:        Include Files and Libraries for developing with Btrfs
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}

%description -n libbtrfs-devel
This package contains the libraries and headers files for developers to
build applications to interface with btrfs.

%prep
%setup -q -n btrfs-progs-%{tar_version}
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch1000 -p1
%patch1001 -p1

%build
make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \
        btrfs-zero-log btrfs-select-super btrfs-image btrfstune \
        btrfs-find-root

%install
make install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_prefix} bindir=%{_sbindir} 
mandir=%{_mandir} libdir=%{_libdir}
install -m 0755 -d ${RPM_BUILD_ROOT}/%{_sbindir}
install -m 0755 -d ${RPM_BUILD_ROOT}/%{_bindir}
# move some utilities out of /usr/sbin
mv ${RPM_BUILD_ROOT}/%{_sbindir}/btrfs-map-logical ${RPM_BUILD_ROOT}/%{_bindir}
# mkinitrd rescue utilities
install -m 0755 btrfs-zero-log ${RPM_BUILD_ROOT}/%{_sbindir}
install -m 0755 btrfs-select-super ${RPM_BUILD_ROOT}/%{_sbindir}
install -m 0755 btrfs-image ${RPM_BUILD_ROOT}/%{_sbindir}
install -m 0755 btrfstune ${RPM_BUILD_ROOT}/%{_sbindir}
install -m 0755 btrfs-find-root ${RPM_BUILD_ROOT}/%{_sbindir}
#UsrMerge
install -m 0755 -d ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-zero-log ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-convert ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-select-super ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-image ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfstune ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfsck ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-find-root ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-debug-tree ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/btrfs-show-super ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/mkfs.btrfs ${RPM_BUILD_ROOT}/sbin
#EndUsrMerge
# command line options are not compatible (bnc#599224)
echo -e '#!/bin/sh\nexit 0' > ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
chmod +x ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
#UsrMerge
ln -s %{_sbindir}/fsck.btrfs ${RPM_BUILD_ROOT}/sbin
#EndUsrMerge
install -d -m0755 ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
install -m 0755 %{S:1} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
install -m 0755 %{S:4} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la
# don't install .a for now
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a

%post -n libbtrfs0 -p /sbin/ldconfig

%postun -n libbtrfs0 -p /sbin/ldconfig

%files
%defattr(-, root, root)
/sbin/fsck.btrfs
# mkinitrd utils
#UsrMerge
/sbin/btrfs
/sbin/btrfs-zero-log
/sbin/btrfs-convert
/sbin/btrfs-select-super
/sbin/btrfs-image
/sbin/btrfstune
/sbin/btrfsck
/sbin/btrfs-find-root
/sbin/mkfs.btrfs
/sbin/btrfs-debug-tree
/sbin/btrfs-show-super
#EndUsrMerge
%{_sbindir}/btrfs
%{_sbindir}/btrfs-zero-log
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-select-super
%{_sbindir}/btrfs-image
%{_sbindir}/btrfstune
%{_sbindir}/btrfsck
%{_sbindir}/btrfs-find-root
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%{_sbindir}/btrfs-debug-tree
%{_sbindir}/btrfs-show-super
/lib/mkinitrd/scripts/boot-btrfs.sh
/lib/mkinitrd/scripts/setup-btrfs.sh
# other
/usr/bin/btrfs-map-logical
%_mandir/man8/btrfs-image.8.gz
%_mandir/man8/btrfsck.8.gz
%_mandir/man8/mkfs.btrfs.8.gz
%_mandir/man8/btrfs.8.gz
%_mandir/man8/btrfs-convert.8.gz
%_mandir/man8/btrfs-debug-tree.8.gz
%_mandir/man8/btrfs-find-root.8.gz
%_mandir/man8/btrfs-map-logical.8.gz
%_mandir/man8/btrfs-show-super.8.gz
%_mandir/man8/btrfs-zero-log.8.gz
%_mandir/man8/btrfstune.8.gz

%files -n libbtrfs0
%defattr(-, root, root)
%{_libdir}/libbtrfs.so.*

%files -n libbtrfs-devel
%defattr(-, root, root)
%dir %{_includedir}/btrfs
%{_includedir}/btrfs/*
%{_libdir}/libbtrfs.so

%changelog
++++++ 0162-btrfs-progs-fix-loop-device-mount-checks.patch ++++++
>From fa69bc83f210e7940adf1051709178e493f58002 Mon Sep 17 00:00:00 2001
From: David Sterba <[email protected]>
Date: Thu, 27 Oct 2011 16:23:14 -0400
Subject: [PATCH 162/170] btrfs-progs: fix loop device mount checks

When creating a fs on a loop device, mkfs checks whether the same file
is not already mounted, but the backing file of another loop dev may not
exist and mkfs fails.

Signed-off-by: David Sterba <[email protected]>
---
 utils.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/utils.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/utils.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/utils.c
@@ -831,11 +831,11 @@ static int is_same_blk_file(const char*
        char real_a[PATH_MAX];
        char real_b[PATH_MAX];
 
-       if(!realpath(a, real_a) ||
-          !realpath(b, real_b))
-       {
-               return -errno;
-       }
+       if(!realpath(a, real_a))
+               strcpy(real_a, a);
+
+       if (!realpath(b, real_b))
+               strcpy(real_b, b);
 
        /* Identical path? */
        if(strcmp(real_a, real_b) == 0)
@@ -876,8 +876,8 @@ static int is_same_loop_file(const char*
 {
        char res_a[PATH_MAX];
        char res_b[PATH_MAX];
-       const char* final_a;
-       const char* final_b;
+       const char* final_a = NULL;
+       const char* final_b = NULL;
        int ret;
 
        /* Resolve a if it is a loop device */
@@ -886,10 +886,12 @@ static int is_same_loop_file(const char*
                        return 0;
                return ret;
        } else if (ret) {
-               if ((ret = resolve_loop_device(a, res_a, sizeof(res_a))) < 0)
-                       return ret;
-
-               final_a = res_a;
+               if ((ret = resolve_loop_device(a, res_a, sizeof(res_a))) < 0) {
+                       if (errno != EPERM)
+                               return ret;
+               }
+               else
+                       final_a = res_a;
        } else {
                final_a = a;
        }
@@ -900,10 +902,12 @@ static int is_same_loop_file(const char*
                        return 0;
                return ret;
        } else if (ret) {
-               if((ret = resolve_loop_device(b, res_b, sizeof(res_b))) < 0)
-                       return ret;
-
-               final_b = res_b;
+               if ((ret = resolve_loop_device(b, res_b, sizeof(res_b))) < 0) {
+                       if (errno != EPERM)
+                               return ret;
+               }
+               else
+                       final_b = res_b;
        } else {
                final_b = b;
        }
++++++ 0163-btrfs-progs-fsck-fix-segfault.patch ++++++
>From f0294c7f1135acd58320c8282ed68a337138a7c7 Mon Sep 17 00:00:00 2001
From: David Sterba <[email protected]>
Date: Mon, 30 Apr 2012 17:46:53 +0200
Subject: [PATCH 163/170] btrfs-progs: fsck: fix segfault

fix from Chris Mason via pastebin

Signed-off-by: David Sterba <[email protected]>
---
 cmds-check.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/cmds-check.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/cmds-check.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/cmds-check.c
@@ -2209,7 +2209,8 @@ static int check_owner_ref(struct btrfs_
                if (btrfs_header_owner(buf) == back->root)
                        return 0;
        }
-       BUG_ON(rec->is_root);
+       if (rec->is_root)
+               return 1;
 
        /* try to find the block by search corresponding fs tree */
        key.objectid = btrfs_header_owner(buf);
++++++ 0164-btrfs-progs-convert-set-label-or-copy-from-origin.patch ++++++
>From f160d979c4f8d46a9d0a52394240d51b78237d89 Mon Sep 17 00:00:00 2001
From: David Sterba <[email protected]>
Date: Tue, 31 Jan 2012 14:40:22 +0100
Subject: [PATCH 164/170] btrfs-progs: convert: set label or copy from origin

Signed-off-by: David Sterba <[email protected]>
---
 btrfs-convert.c | 47 ++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 38 insertions(+), 9 deletions(-)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-convert.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/btrfs-convert.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-convert.c
@@ -2199,8 +2199,8 @@ err:
        return ret;
 }
 
-static int do_convert(const char *devname, int datacsum, int packing,
-               int noxattr)
+static int do_convert(const char *devname, int datacsum, int packing, int 
noxattr,
+              int copylabel, const char *fslabel)
 {
        int i, ret;
        int fd = -1;
@@ -2294,6 +2294,17 @@ static int do_convert(const char *devnam
                fprintf(stderr, "error during create_ext2_image %d\n", ret);
                goto fail;
        }
+       memset(root->fs_info->super_copy->label, 0, BTRFS_LABEL_SIZE);
+       if (copylabel == 1) {
+               strncpy(root->fs_info->super_copy->label,
+                               ext2_fs->super->s_volume_name, 16);
+               fprintf(stderr, "copy label '%s'\n",
+                               root->fs_info->super_copy->label);
+       } else if (copylabel == -1) {
+               strncpy(root->fs_info->super_copy->label, fslabel, 
BTRFS_LABEL_SIZE);
+               fprintf(stderr, "set label to '%s'\n", fslabel);
+       }
+
        printf("cleaning up system chunk.\n");
        ret = cleanup_sys_chunk(root, ext2_root);
        if (ret) {
@@ -2688,11 +2699,13 @@ fail:
 
 static void print_usage(void)
 {
-       printf("usage: btrfs-convert [-d] [-i] [-n] [-r] device\n");
-       printf("\t-d disable data checksum\n");
-       printf("\t-i ignore xattrs and ACLs\n");
-       printf("\t-n disable packing of small files\n");
-       printf("\t-r roll back to ext2fs\n");
+       printf("usage: btrfs-convert [-d] [-i] [-n] [-r] [-l label] [-L] 
device\n");
+       printf("\t-d           disable data checksum\n");
+       printf("\t-i           ignore xattrs and ACLs\n");
+       printf("\t-n           disable packing of small files\n");
+       printf("\t-r           roll back to ext2fs\n");
+       printf("\t-l LABEL     set filesystem label\n");
+       printf("\t-L           use label from converted fs\n");
 }
 
 int main(int argc, char *argv[])
@@ -2702,9 +2715,12 @@ int main(int argc, char *argv[])
        int noxattr = 0;
        int datacsum = 1;
        int rollback = 0;
+       int copylabel = 0;
        char *file;
+       char *fslabel = NULL;
+
        while(1) {
-               int c = getopt(argc, argv, "dinr");
+               int c = getopt(argc, argv, "dinrl:L");
                if (c < 0)
                        break;
                switch(c) {
@@ -2720,6 +2736,19 @@ int main(int argc, char *argv[])
                        case 'r':
                                rollback = 1;
                                break;
+                       case 'l':
+                               copylabel = -1;
+                               fslabel = strdup(optarg);
+                               if (strlen(fslabel) > BTRFS_LABEL_SIZE) {
+                                       fprintf(stderr,
+                                               "warning: label too long, 
trimmed to %d bytes\n",
+                                               BTRFS_LABEL_SIZE);
+                                       fslabel[BTRFS_LABEL_SIZE]=0;
+                               }
+                               break;
+                       case 'L':
+                               copylabel = 1;
+                               break;
                        default:
                                print_usage();
                                return 1;
@@ -2740,7 +2769,7 @@ int main(int argc, char *argv[])
        if (rollback) {
                ret = do_rollback(file, 0);
        } else {
-               ret = do_convert(file, datacsum, packing, noxattr);
+               ret = do_convert(file, datacsum, packing, noxattr, copylabel, 
fslabel);
        }
        if (ret)
                return 1;
++++++ 0165-Revert-btrfs-progs-update-options-in-find-root.c.patch ++++++
>From 0c26634f696f3ced9636de0ca2fa5b7b9d732bc3 Mon Sep 17 00:00:00 2001
From: David Sterba <[email protected]>
Date: Thu, 7 Feb 2013 18:00:23 +0100
Subject: [PATCH 165/170] Revert "btrfs-progs: update options in find-root.c"

This reverts commit 7f04a61b6da5a1231454b07e3e37cc24601a76e4.

Reintroduce the 'verbose' option.

Signed-off-by: David Sterba <[email protected]>
---
 btrfs-find-root.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-find-root.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/btrfs-find-root.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-find-root.c
@@ -35,6 +35,7 @@
 #include "utils.h"
 #include "crc32c.h"
 
+static int verbose = 0;
 static u16 csum_size = 0;
 static u64 search_objectid = BTRFS_ROOT_TREE_OBJECTID;
 static u64 search_generation = 0;
@@ -42,7 +43,7 @@ static unsigned long search_level = 0;
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: find-roots [-o search_objectid] "
+       fprintf(stderr, "Usage: find-roots [-v] "
                "[ -g search_generation ] [ -l search_level ] <device>\n");
 }
 
@@ -286,9 +287,12 @@ int main(int argc, char **argv)
        int opt;
        int ret;
 
-       while ((opt = getopt(argc, argv, "l:o:g:")) != -1) {
+       while ((opt = getopt(argc, argv, "l:o:g:v")) != -1) {
                switch(opt) {
                        errno = 0;
+                       case 'v':
+                               verbose++;
+                               break;
                        case 'o':
                                search_objectid = (u64)strtoll(optarg, NULL,
                                                               10);
++++++ 0166-Btrfs-progs-add-some-verbose-output-to-find-root.patch ++++++
>From 3d75a27a857ae81f7cd64de886a293208be15af6 Mon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Wed, 4 Jan 2012 10:03:33 -0500
Subject: [PATCH 166/170] Btrfs-progs: add some verbose output to find-root

Trying to track down why we can't find roots, add some verbose output so we know
what chunks we're scanning and when we move to new chunks.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
---
 btrfs-find-root.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-find-root.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/btrfs-find-root.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/btrfs-find-root.c
@@ -229,6 +229,10 @@ static int find_root(struct btrfs_root *
                return ret;
 
        offset = metadata_offset;
+       if (verbose)
+               printf("Checking metadata chunk %Lu, size %Lu\n",
+                      metadata_offset, metadata_size);
+
        while (1) {
                u64 map_length = 4096;
                u64 type;
@@ -239,6 +243,8 @@ static int find_root(struct btrfs_root *
                        break;
                }
                if (offset >= (metadata_offset + metadata_size)) {
+                       if (verbose)
+                               printf("Moving to the next metadata chunk\n");
                        err = btrfs_next_metadata(&root->fs_info->mapping_tree,
                                                  &metadata_offset,
                                                  &metadata_size);
@@ -247,6 +253,9 @@ static int find_root(struct btrfs_root *
                                break;
                        }
                        offset = metadata_offset;
+                       if (verbose)
+                               printf("Checking metadata chunk %Lu, size %Lu"
+                                      "\n", metadata_offset, metadata_size);
                }
                err = __btrfs_map_block(&root->fs_info->mapping_tree, READ,
                                      offset, &map_length, &type,
++++++ 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch ++++++
>From cc4992b4c3610de4b30ea6a168573841e6cd43e5 Mon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Wed, 7 Dec 2011 16:11:23 -0500
Subject: [PATCH 167/170] Btrfs-progs: make find_and_setup_root return an error

Don't BUG(), return an error so the recovery program can work its mojo.

Signed-off-by: Josef Bacik <[email protected]>
---
 disk-io.c | 2 ++
 1 file changed, 2 insertions(+)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/disk-io.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/disk-io.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/disk-io.c
@@ -524,6 +524,8 @@ static int find_and_setup_root(struct bt
        generation = btrfs_root_generation(&root->root_item);
        root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item),
                                     blocksize, generation);
+       if (!root->node)
+               return -ENOENT;
        if (!extent_buffer_uptodate(root->node))
                return -EIO;
 
++++++ 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch ++++++
>From 6c90b5f56a389b37fcdd85e6dd904288d601b27a Mon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Wed, 7 Dec 2011 15:54:13 -0500
Subject: [PATCH 168/170] Btrfs-progs: don't bug out if we can't find the last
 root

Return an error instead of BUG()'ing out.

Signed-off-by: Josef Bacik <[email protected]>
---
 root-tree.c | 5 +++++
 1 file changed, 5 insertions(+)

Index: btrfs-progs-v0.20-rc1-598-g8116550e1662/root-tree.c
===================================================================
--- btrfs-progs-v0.20-rc1-598-g8116550e1662.orig/root-tree.c
+++ btrfs-progs-v0.20-rc1-598-g8116550e1662/root-tree.c
@@ -45,6 +45,11 @@ int btrfs_find_last_root(struct btrfs_ro
 
        BUG_ON(ret == 0);
        l = path->nodes[0];
+       if (path->slots[0] == 0) {
+               ret = -ENOENT;
+               goto out;
+       }
+
        slot = path->slots[0] - 1;
        btrfs_item_key_to_cpu(l, &found_key, slot);
        if (found_key.objectid != objectid) {
++++++ 0169-btrfs-progs-Check-metadata-mirrors-in-find-root.patch ++++++
>From 4469ed43b26b6e7d5ad5cfea45e99708e39de4a6 Mon Sep 17 00:00:00 2001
From: David Marcin <[email protected]>
Date: Wed, 16 Nov 2011 12:18:08 -0800
Subject: [PATCH 169/170] btrfs-progs: Check metadata mirrors in find-root.

Signed-off-by: David Marcin <[email protected]>
---
 btrfs-find-root.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 7f7b64f..ffbdde1 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -236,6 +236,8 @@ static int find_root(struct btrfs_root *root)
        while (1) {
                u64 map_length = 4096;
                u64 type;
+               int mirror_num;
+               int num_copies;
 
                if (offset >
                    btrfs_super_total_bytes(root->fs_info->super_copy)) {
@@ -257,9 +259,11 @@ static int find_root(struct btrfs_root *root)
                                printf("Checking metadata chunk %Lu, size %Lu"
                                       "\n", metadata_offset, metadata_size);
                }
+               mirror_num = 1;
+       again:
                err = __btrfs_map_block(&root->fs_info->mapping_tree, READ,
                                      offset, &map_length, &type,
-                                     &multi, 0, NULL);
+                                     &multi, mirror_num, NULL);
                if (err) {
                        offset += map_length;
                        continue;
@@ -278,9 +282,16 @@ static int find_root(struct btrfs_root *root)
 
                err = read_physical(root, fd, offset, bytenr, map_length);
                if (!err) {
+                       /* Found the root. */
                        ret = 0;
                        break;
                } else if (err < 0) {
+                       num_copies = 
btrfs_num_copies(&root->fs_info->mapping_tree,
+                                                     offset, map_length);
+                       mirror_num++;
+                       if (mirror_num <= num_copies)
+                               goto again;
+                       /* Unrecoverable error in read. */
                        ret = err;
                        break;
                }
-- 
1.8.3.1

++++++ 0170-btrfs-progs-In-find-root-dump-bytenr-for-every-slot.patch ++++++
>From 1e9e1d5c876a4c281b3b9e72f4cbaaef1e3a2fa5 Mon Sep 17 00:00:00 2001
From: David Marcin <[email protected]>
Date: Mon, 21 Nov 2011 20:51:15 -0600
Subject: [PATCH 170/170] btrfs-progs: In find-root, dump bytenr for every
 slot.

Signed-off-by: David Marcin <[email protected]>
---
 btrfs-find-root.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index ffbdde1..00b10e7 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -127,8 +127,63 @@ out:
        return NULL;
 }
 
+static int dump_root_bytenr(struct btrfs_root *root, u64 bytenr, u64 gen)
+{
+       struct btrfs_root *tmp = malloc(sizeof(struct btrfs_root));
+       struct btrfs_path *path;
+       struct btrfs_key key;
+       struct btrfs_root_item ri;
+       struct extent_buffer *leaf;
+       struct btrfs_disk_key disk_key;
+       struct btrfs_key found_key;
+       int slot;
+       int ret;
+
+       if (!tmp)
+               return -ENOMEM;
+
+       __setup_root(4096, 4096, 4096, 4096, tmp,
+                    root->fs_info, BTRFS_ROOT_TREE_OBJECTID);
+
+       tmp->node = read_tree_block(root, bytenr, 4096, gen);
+
+       key.objectid = 0;
+       key.type = BTRFS_ROOT_ITEM_KEY;
+       key.offset = -1;
+
+       path = btrfs_alloc_path();
+
+       /* Walk the slots of this root looking for BTRFS_ROOT_ITEM_KEYs. */
+       ret = btrfs_search_slot(NULL, tmp, &key, path, 0, 0);
+       BUG_ON(ret < 0);
+       while (1) {
+               leaf = path->nodes[0];
+               slot = path->slots[0];
+               if (slot >= btrfs_header_nritems(leaf)) {
+                       ret = btrfs_next_leaf(tmp, path);
+                       if (ret != 0)
+                               break;
+                       leaf = path->nodes[0];
+                       slot = path->slots[0];
+               }
+               btrfs_item_key(leaf, &disk_key, path->slots[0]);
+               btrfs_disk_key_to_cpu(&found_key, &disk_key);
+               if (btrfs_key_type(&found_key) == BTRFS_ROOT_ITEM_KEY) {
+                       unsigned long offset;
+
+                       offset = btrfs_item_ptr_offset(leaf, slot);
+                       read_extent_buffer(leaf, &ri, offset, sizeof(ri));
+                       printf("Generation: %Lu Root bytenr: %Lu\n", gen, 
btrfs_root_bytenr(&ri));
+               }
+               path->slots[0]++;
+       }
+       btrfs_free_path(path);
+       free_extent_buffer(leaf);
+       return 0;
+}
+
 static int search_iobuf(struct btrfs_root *root, void *iobuf,
-                       size_t iobuf_size, off_t offset)
+                        size_t iobuf_size, off_t offset)
 {
        u64 gen = search_generation;
        u64 objectid = search_objectid;
@@ -160,6 +215,9 @@ static int search_iobuf(struct btrfs_root *root, void 
*iobuf,
                                h_byte);
                        goto next;
                }
+               /* Found some kind of root and it's fairly valid. */
+               if (dump_root_bytenr(root, h_byte, h_gen))
+                       break;
                if (h_gen != gen) {
                        fprintf(stderr, "Well block %Lu seems great, "
                                "but generation doesn't match, "
-- 
1.8.3.1

++++++ boot-btrfs.sh ++++++
#!/bin/bash -e
#%stage: filesystem
#%depends: dm dmraid lvm2 udev md luks
#%programs: btrfs
#%programs: btrfs-convert
#%programs: btrfs-debug-tree
#%programs: btrfs-dump-super
#%programs: btrfs-find-root
#%programs: btrfs-image
#%programs: btrfs-select-super
#%programs: btrfs-zero-log
#%programs: btrfsck
#%programs: btrfstune
# for fsck(8): listed twice so that a copy really ends up in /sbin
#%programs: /sbin/fsck.btrfs
#%programs: fsck.btrfs
#%programs: mkfs.btrfs
#%modules: btrfs

modprobe btrfs

btrfs dev scan >& /dev/null
++++++ local-version-override.patch ++++++
Index: btrfs-progs-v0.19-116-g13eced9/version.sh
===================================================================
--- btrfs-progs-v0.19-116-g13eced9.orig/version.sh
+++ btrfs-progs-v0.19-116-g13eced9/version.sh
@@ -6,7 +6,7 @@
 # Copyright 2008, Oracle
 # Released under the GNU GPLv2
  
-v="v3.12"
+v="v3.12+20131125"
 
 which git &> /dev/null
 if [ $? == 0 -a -d .git ]; then
++++++ mkfs-default-4k-nodes.diff ++++++
Upstream change, reverted to original value for the time being.

--- a/mkfs.c.orig       2013-11-26 18:14:57.603783743 +0100
+++ b/mkfs.c    2013-11-26 18:15:24.650014406 +0100
@@ -48,7 +48,7 @@ static u64 index_cnt = 2;
 
 #define DEFAULT_MKFS_FEATURES  (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)
 
-#define DEFAULT_MKFS_LEAF_SIZE 16384
+#define DEFAULT_MKFS_LEAF_SIZE 4096
 
 struct directory_name_entry {
        char *dir_name;
++++++ setup-btrfs.sh ++++++
#!/bin/bash
#
#%stage: filesystem

mkdir -p $tmp_mnt/etc/udev/rules.d
cp /usr/lib/udev/rules.d/64-btrfs.rules $tmp_mnt/etc/udev/rules.d
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to