Hello community,

here is the log from the commit of package btrfsprogs.2152 for 
openSUSE:13.1:Update checked in at 2013-10-31 14:02:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.1:Update/btrfsprogs.2152 (Old)
 and      /work/SRC/openSUSE:13.1:Update/.btrfsprogs.2152.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "btrfsprogs.2152"

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

--- /dev/null   2013-10-11 12:16:15.204037506 +0200
+++ /work/SRC/openSUSE:13.1:Update/.btrfsprogs.2152.new/btrfsprogs.changes      
2013-10-31 14:02:59.000000000 +0100
@@ -0,0 +1,295 @@
+-------------------------------------------------------------------
+Mon Sep 16 15:49:00 UTC 2013 - je...@suse.com
+
+- update to upstream master (194aa4a1)
+  - btrfs-restore: deal with NULL returns from read_node_slot
+  - btrfs-restore: use the correct leafsize when reading the FS location
+  - btrfs-find-root: Add options to control generation and level
+  - btrfsck: fix incorrect casting on items in the corrupt_blocks tree
+  - Btrfs-progs: fix closing of devices
+  - Btrfs-progs: enhance btrfs-image to restore image onto multiple disks
+  - Btrfs-progs: cleanup btrfs-image usage
+  - Btrfs-progs: delete fs_devices itself from fs_uuid list before freeing
+  - Btrfs-progs: skip open devices which is missing
+  - Btrfs-progs: fix misuse of skinny metadata in btrfs-image
+  - Btrfs-progs: recover raid0/raid10/raid5/raid6 metadata chunk
+  - Btrfs-progs: Add chunk rebuild function for RAID1/SINGLE/DUP
+  - Btrfs-progs: introduce list_{first, next}_entry/list_splice_tail{_init}
+  - Btrfs-progs: Add chunk recover function - using old chunk items
+  - Btrfs-progs: Add block group check funtion
+  - Btrfs-progs: extend the extent cache for the device extent
+  - Btrfs-progs: use rb-tree instead of extent cache tree for fs/file roots
+  - Btrfs-progs: introduce common insert/search/delete functions for rb-tree
+  - Btrfs-progs: cleanup similar code in open_ctree_* and close_ctree
+  - Btrfs-progs: Don't free the devices when close the ctree
+  - Btrfs-progs: don't close the file descriptor 0 when closing a device
+  - Btrfs-progs: fix missing recow roots when making btrfs filesystem
+
+- Add fix for passing super_nr while opening ctree
+
+-------------------------------------------------------------------
+Thu Sep  5 16:33:50 CEST 2013 - dste...@suse.cz
+
+- btrfs-progs-mkfs-default-extref.diff: turn on extended refs by
+  default, (aka hardlink count limtitation) (bnc#835695)
+
+-------------------------------------------------------------------
+Fri Aug  9 14:03:04 CEST 2013 - dste...@suse.cz
+
+- added 0040-btrfs-progs-fix-loop-device-mount-checks.patch: fix
+  loop mount detection again (bnc#834173)
+
+-------------------------------------------------------------------
+Mon Jul 22 17:50:52 CEST 2013 - oher...@suse.de
+
+- Simplify checks in mkinitrd scripts.
+  They are always true because they come from the same package
+  Use relative paths to binaries
+- Move udev rules to /usr.
+- Adjust rules to call binary from /usr
+- Simplify fsck.btrfs, its just a dummy until fixed
+
+-------------------------------------------------------------------
+Thu Jul  4 12:30:41 CEST 2013 - dste...@suse.cz
+
+- update to upstream master (f00dd8386a57d241d0f7c)
+
+-------------------------------------------------------------------
+Sun Jun 16 23:39:42 UTC 2013 - jeng...@inai.de
+
+- Make requirement on libattr-devel explicit
+
+-------------------------------------------------------------------
+Fri Apr 13 16:06:50 CEST 2012 - dste...@suse.cz
+
+- initrd support: add module (bnc#750185, bnc#727383)
+
+-------------------------------------------------------------------
+Tue Apr 10 21:50:00 UTC 2012 - frank.lichtenh...@sophos.com
+
+- set correct file mode if writing replacement fsck
+
+-------------------------------------------------------------------
+Fri Apr  6 13:57:43 CEST 2012 - dste...@suse.cz
+
+- fix build failure
+
+-------------------------------------------------------------------
+Fri Apr  6 13:27:48 CEST 2012 - dste...@suse.cz
+
+- add btrfs-debug-tree to initrd
+- adjust fs size to correct size (bnc#744593)
+- man page documentation updates
+- do not package obsolete utilities
+- mkfs: store correct size of device in superblock (bnc#730103)
+- updated restriper/balance commands to match kernel version
+
+-------------------------------------------------------------------
+Fri Mar  9 16:26:20 UTC 2012 - rschweik...@suse.com
+
+- place binaries in /usr tree (UsrMerge project)
+- adjust mkinitrd scrippt accordingly
+
+-------------------------------------------------------------------
+Mon Mar  5 13:06:43 CET 2012 - dste...@suse.cz
+
+- 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 (bnc#749540)
+- 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 - co...@suse.com
+
+- patch license to follow spdx.org standard
+
+-------------------------------------------------------------------
+Mon Dec 12 15:44:48 CET 2011 - dkuka...@suse.de
+
+- 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 - dste...@suse.cz
+
+- 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 - dste...@suse.cz
+
+- updated mkinitrd script to scan devices before mount (bnc#727383)
+
+-------------------------------------------------------------------
+
+Wed Nov  9 14:34:56 CET 2011 - dste...@suse.cz
+
+- 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 - dste...@suse.cz
+
+- btrfsck: ignore -a (bnc#655906)
+- btrfsck: fix strerror value
+
+-------------------------------------------------------------------
+Sat Sep 17 20:58:20 UTC 2011 - jeng...@medozas.de
+
+- Remove redundant tags/sections from specfile
+- Use %_smp_mflags for parallel build
+
+-------------------------------------------------------------------
+Thu Aug  4 21:52:12 CEST 2011 - dste...@suse.cz
+
+- 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 - dste...@suse.cz
+
+- reorder help for 'get-default' right after 'set-default'
+
+-------------------------------------------------------------------
+Thu Jul 28 19:10:08 CEST 2011 - dste...@suse.cz
+
+- add option -p to print parent subvolume
+- add subvolume 'get-default' subsubcommand
+
+-------------------------------------------------------------------
+Wed Jul 20 19:12:46 CEST 2011 - dste...@suse.cz
+
+- remove debugging printf from
+  0001-Btrfs-progs-add-a-btrfs-select-super-command-to-over.patch
+
+-------------------------------------------------------------------
+Fri Jul  1 16:59:41 CEST 2011 - dste...@suse.cz
+
+- 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 - dmuel...@suse.de
+
+- fix failing on deleted loop mounts (bnc#697671)
++++ 98 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:13.1:Update/.btrfsprogs.2152.new/btrfsprogs.changes

New:
----
  0010-Btrfs-progs-make-btrfsck-a-hardlink-at-install-time.patch
  0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch
  0040-btrfs-progs-fix-loop-device-mount-checks.patch
  80-btrfs.rules
  boot-btrfs.sh
  btrfs-dev-clear-sb
  btrfs-progs-add-man-page-for-btrfs-convert.patch
  btrfs-progs-mkfs-default-extref.diff
  btrfs-progs-restore-passing-of-super_bytenr-to-device-scan
  btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
  btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2
  btrfsprogs.changes
  btrfsprogs.spec
  local-version-override.patch
  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:        0.20
Release:        7
%define tar_version v0.20-rc1-358-g194aa4a
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
# git archive --format=tar --prefix=btrfs-progs-`git describe --tags --match 
"v*"`/ HEAD > %D/btrfs-progs-`git describe --tags --match "v*"`.tar
Source:         btrfs-progs-%{tar_version}.tar.bz2
Source1:        boot-btrfs.sh
Source4:        setup-btrfs.sh
Source2:        btrfs-dev-clear-sb
Source3:        80-btrfs.rules
Patch10:        0010-Btrfs-progs-make-btrfsck-a-hardlink-at-install-time.patch
Patch12:        0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch
Patch40:        0040-btrfs-progs-fix-loop-device-mount-checks.patch
Patch1:         btrfs-progs-mkfs-default-extref.diff
Patch1000:      local-version-override.patch
Patch1001:      btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
Patch1002:      btrfs-progs-add-man-page-for-btrfs-convert.patch
Patch1003:      btrfs-progs-restore-passing-of-super_bytenr-to-device-scan

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libacl-devel
BuildRequires:  libattr-devel
BuildRequires:  libblkid-devel
BuildRequires:  libext2fs-devel
BuildRequires:  libuuid-devel
BuildRequires:  lzo-devel
BuildRequires:  udev
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}
%patch10 -p1
%patch12 -p1
%patch40 -p1
%patch1 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -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/
install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/
install -d -m 0755 $RPM_BUILD_ROOT/usr/lib/udev/rules.d
install -m 0644 %{S:3} $RPM_BUILD_ROOT/usr/lib/udev/rules.d
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
/usr/sbin/btrfs-dev-clear-sb
/lib/mkinitrd/scripts/boot-btrfs.sh
/lib/mkinitrd/scripts/setup-btrfs.sh
# other
/usr/bin/btrfs-map-logical
/usr/sbin/btrfs-dev-clear-sb
%_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
%dir /usr/lib/udev/
%dir /usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/80-btrfs.rules

%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
++++++ 0010-Btrfs-progs-make-btrfsck-a-hardlink-at-install-time.patch ++++++
>From 5ca1ded494d7d58b71877bf1f774ac313fabe35f Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sand...@redhat.com>
Date: Thu, 2 May 2013 11:20:22 -0500
Subject: [PATCH 10/48] Btrfs-progs: make btrfsck a hardlink at install time

btrfsck gets hardlinked to btrfs during the build, but the
install phase simply copies them both to the destination without
preserving the link.

Just force-link btrfsck in the destination again during install
so that the installed btrfsck is a link as well.

Signed-off-by: Eric Sandeen <sand...@redhat.com>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index da7438e..0f0b1ac 100644
--- a/Makefile
+++ b/Makefile
@@ -193,6 +193,8 @@ clean :
 install: $(libs) $(progs) install-man
        $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
        $(INSTALL) $(progs) $(DESTDIR)$(bindir)
+       # btrfsck is a link to btrfs in the src tree, make it so for installed 
file as well
+       $(LN) -f $(DESTDIR)$(bindir)/btrfs $(DESTDIR)$(bindir)/btrfsck
        $(INSTALL) -m755 -d $(DESTDIR)$(libdir)
        $(INSTALL) $(libs) $(DESTDIR)$(libdir)
        cp -a $(lib_links) $(DESTDIR)$(libdir)
-- 
1.8.2

++++++ 0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch ++++++
>From 86f2f0e7742ccbfaf62e2d6415bf170a85c71c0e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjo...@redhat.com>
Date: Sun, 12 May 2013 16:33:44 +0100
Subject: [PATCH 12/48] libbtrfs: Set SONAME to "libbtrfs.so.0" (instead of
 "libbtrfs.so").

Signed-off-by: Richard W.M. Jones <rjo...@redhat.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0f0b1ac..7a49174 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ version.h:
 $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
        @echo "    [LD]     $@"
        $(Q)$(CC) $(CFLAGS) $(libbtrfs_objects) $(LDFLAGS) $(lib_LIBS) \
-               -shared -Wl,-soname,libbtrfs.so -o libbtrfs.so.0.1
+               -shared -Wl,-soname,libbtrfs.so.0 -o libbtrfs.so.0.1
 
 $(libs_static): $(libbtrfs_objects)
        @echo "    [AR]     $@"
-- 
1.8.2

++++++ 0040-btrfs-progs-fix-loop-device-mount-checks.patch ++++++
>From be65fb331902152d9b571b2d4ee1bf26bedc795f Mon Sep 17 00:00:00 2001
From: David Sterba <dste...@suse.cz>
Date: Thu, 27 Oct 2011 16:23:14 -0400
Subject: [PATCH 40/46] 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 <dste...@suse.cz>
---
 utils.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/utils.c b/utils.c
index 41bfdb0..47b31fc 100644
--- a/utils.c
+++ b/utils.c
@@ -773,11 +773,11 @@ int is_same_blk_file(const char* a, const char* b)
        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)
@@ -818,8 +818,8 @@ int is_same_loop_file(const char* a, const char* b)
 {
        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 */
@@ -828,10 +828,12 @@ int is_same_loop_file(const char* a, const char* b)
                        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;
        }
@@ -842,10 +844,12 @@ int is_same_loop_file(const char* a, const char* b)
                        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;
        }
-- 
1.8.0.2

++++++ 80-btrfs.rules ++++++
SUBSYSTEM!="block", GOTO="btrfs_end"
ACTION!="add|change", GOTO="btrfs_end"

ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", GOTO="btrfs_end"
ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="btrfs_end"

ENV{ID_FS_TYPE}=="btrfs", GOTO="btrfs_do_scan"
ENV{DM_UUID}=="LVM-?*", GOTO="btrfs_do_scan"
ENV{DM_UUID}=="LUKS-CRYPT1-?*", GOTO="btrfs_do_scan"
ENV{DM_UUID}=="LUKS-PLAIN-?*", GOTO="btrfs_do_scan"
ENV{DM_UUID}=="LUKS-VERITY-?*", GOTO="btrfs_do_scan"
ENV{DM_UUID}=="LUKS-LOOPAES-?*", GOTO="btrfs_do_scan"
ENV{MD_UUID}=="?*", GOTO="btrfs_do_scan"
GOTO="btrfs_end"

LABEL="btrfs_do_scan"
RUN+="/sbin/modprobe btrfs"
RUN+="/usr/sbin/btrfs device scan $env{DEVNAME}"

LABEL="btrfs_end"
++++++ 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
++++++ btrfs-dev-clear-sb ++++++
#!/usr/bin/perl

# clear btrfs signature from a device

use Fcntl;

use constant BTRFS_SUPER_INFO_OFFSET => 64 * 1024;
use constant BTRFS_SUPER_INFO_SIZE => 4096;

use constant BTRFS_SUPER_MIRROR_MAX => 3;
use constant BTRFS_SUPER_MIRROR_SHIFT => 12;

use constant BTRFS_MAGIC => "_BHRfS_M";
use constant BTRFS_DEAD  => '_BHRf$_M';

sub btrfs_sb_offset($) {
        my $mirror =$_[0];
        my $start = 16 * 1024;
        if ($mirror>0) {
                return $start << (BTRFS_SUPER_MIRROR_SHIFT * $mirror);
        }
        return BTRFS_SUPER_INFO_OFFSET;
}

my $dbg=1;
my $savesb=0;

# main
my $dev=$ARGV[0];
my $size;
if(!-b $dev) {
        print("Not a block device: $dev\n");
        $size=(stat($dev))[7];
} else {
        $size=`blockdev --getsize64 "$dev"`;
}
sysopen(F, $dev, O_EXCL | O_RDWR) or die("Cannot open $dev exclusively: $!");
print("Device size: $size\n") if($dbg);
for(my $i=0;$i<6;$i++) {
        my $off=btrfs_sb_offset($i);
        if($off > $size) {
                print("Offset for SB $i beyond EOF\n") if($dbg);
                last;
        }
        print("Offset $i is $off\n") if($dbg);
        sysseek(F, $off, 0);
        sysread(F, $buf, BTRFS_SUPER_INFO_SIZE);
        if($savesb) {
                open(Q,">SB$i");
                print Q ($buf);
                close(Q);
        }
        my $sbmagic=substr($buf, 0x40, length(BTRFS_MAGIC));
        print("SB magic: $sbmagic\n") if($dbg);
        if(BTRFS_MAGIC eq $sbmagic) {
                print("Found a valid signature of superblock $i\n");
                sysseek(F, $off + 0x40, 0);
                print("Clearing...\n");
                syswrite(F, BTRFS_DEAD, length(BTRFS_DEAD));
        } elsif(BTRFS_DEAD eq $sbmagic) {
                print("Found a signature of a dead superblock $i\n");
        } else {
                print("Superblock $i does not look like a btrfs one\n");
        }
}
close(F);
print("Syncing dev\n");
if (!-b $dev) {
        system("fsync \'$dev\'");
} else {
        system("blockdev --flushbufs \'$dev\'");
}
++++++ btrfs-progs-add-man-page-for-btrfs-convert.patch ++++++
>From 3c7ae0fc5139c195100eb931bc6e1148ac1f11f5 Mon Sep 17 00:00:00 2001
From: David Sterba <dste...@suse.cz>
Date: Mon, 26 Mar 2012 15:39:08 +0200
Subject: [PATCH 37/46] btrfs-progs: add man page for btrfs-convert

Signed-off-by: David Sterba <dste...@suse.cz>
---
 man/Makefile           |  2 +-
 man/btrfs-convert.8.in | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 man/btrfs-convert.8.in

Index: btrfs-progs-v0.20-rc1-335-gf00dd83/man/btrfs-convert.8.in
===================================================================
--- /dev/null
+++ btrfs-progs-v0.20-rc1-335-gf00dd83/man/btrfs-convert.8.in
@@ -0,0 +1,60 @@
+.TH BTRFS-CONVERT 8
+.SH NAME
+btrfs-convert \- convert ext2/ext3/ext4 filesystem image to btrfs in-place
+.SH SYNOPSIS
+.B btrfs-convert \fB[\-dinL]\fP \fB[\-r]\fP \fB[\-l\fP \fILABEL\fP\fB]\fP 
\fIdevice\fP
+.SH DESCRIPTION
+.B btrfs-convert
+is used to convert a ext2/ext3/ext4 filesystem image to a btrfs one. This is
+performed on an unmounted image. The conversion is done in-place and it's
+possible to do a rollback to original fs. The original filesystem image is
+accessible as a subvolume named \fIext2\_subvol\fP.
+
+The success of the operation depends on amount of free space in the original
+filesystem, as btrfs uses this space to store it's own metadata and just adds
+pointers to the data blocks.
+
+Duration of the operation depends on fragmentation and allocated space on the
+orignal filesystem, it may take seveal hours for a terabyte-sized filesystem.
+
+If the operation does not finish succesfully, the image is recognized as the
+original fileystem.
+
+.SH OPTIONS
+.TP
+\fB\-d\fP
+Disable data checksumming. This may speed up the convert operation.
+.TP
+\fB\-i\fP
+Do not convert ACLs.
+.TP
+\fB\-n\fP
+Disable packing of small files.
+.TP
+\fB\-l\fR \fILABEL\fP
+Set the label of btrfs filesystem to \fILABEL\fP.
+.TP
+\fB\-L\fP
+Copy label from the original filesystem to btrfs.
+.TP
+\fB\-r\fP
+Try rollback to the original filesystem. Beware that this may not always
+succeed if the btrfs filesystem has been changed in a way that prevents this.
+
+.SH CAVEATS
+The resulting filesystem will inherit the fragmentation and it's possible to
+run whole filesystem defragmentation and then balance.
+
+The raid profile of both data and metada will be \fIsingle\fP, this is not the
+same as default mkfs will create. Use balance with convert filter to change
+raid profile you want.
+
+Security labels or quotas are not transferred to the new filesystem.
+
+Block sizes must be at least of btrfs supported size (currently 4KB on x86_64).
+
+.SH AVAILABILITY
+.B btrfs-convert
+is part of btrfs-progs.
+.SH SEE ALSO
+.BR mkfs.btrfs (8)
Index: btrfs-progs-v0.20-rc1-335-gf00dd83/man/Makefile
===================================================================
--- btrfs-progs-v0.20-rc1-335-gf00dd83.orig/man/Makefile
+++ btrfs-progs-v0.20-rc1-335-gf00dd83/man/Makefile
@@ -11,7 +11,7 @@ man8dir = $(mandir)/man8
 # list only those we use
 .SUFFIXES: .in .gz
 
-MANPAGES = mkfs.btrfs.8.gz btrfsck.8.gz btrfs-image.8.gz btrfs.8.gz
+MANPAGES = mkfs.btrfs.8.gz btrfsck.8.gz btrfs-image.8.gz btrfs.8.gz 
btrfs-convert.8.gz
 INFILES = ${MANPAGES:.in=.gz}
 
 all: $(MANPAGES)
++++++ btrfs-progs-mkfs-default-extref.diff ++++++
Index: btrfs-progs-v0.20-rc1-335-gf00dd83/mkfs.c
===================================================================
--- btrfs-progs-v0.20-rc1-335-gf00dd83.orig/mkfs.c
+++ btrfs-progs-v0.20-rc1-335-gf00dd83/mkfs.c
@@ -1520,6 +1520,8 @@ raid_groups:
 
        super = root->fs_info->super_copy;
        flags = btrfs_super_incompat_flags(super);
+       printf("Turning on extended refs (higher hardlink limit)\n");
+       flags |= BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF;
 
        if (mixed)
                flags |= BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS;
++++++ btrfs-progs-restore-passing-of-super_bytenr-to-device-scan ++++++
>From 3a628f64ccdf41671368474a53c093ab03df1f98 Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <je...@suse.com>
Date: Thu, 15 Aug 2013 20:32:00 -0400
Subject: btrfs-progs: restore passing of super_bytenr to device scan

Commit 615f2867 (Btrfs-progs: cleanup similar code in open_ctree_*
and close_ctree) introduced a regression in btrfs-convert.

open_ctree takes a sb_bytenr argument to specify where to find the
superblock. Under normal conditions, this will be at BTRFS_SUPER_INFO_OFFSET,
and that commit assumed as much under all conditions.

make_btrfs allows the caller to specify which blocks to use for
certain blocks (including the superblock) and this is used by btrfs-convert
to avoid overwriting the source file system's superblock until the
conversion is complete.

When btrfs-convert goes to open the newly initialized file system, it
fails with: "No valid btrfs found" since its superblock wasn't written
to the normal location.

This patch restores the passing down of super_bytesnr to
btrfs_scan_one_device.

Signed-off-by: Jeff Mahoney <je...@suse.com>
---
 btrfs-find-root.c |  2 +-
 cmds-chunk.c      |  2 +-
 disk-io.c         | 10 +++++++---
 disk-io.h         |  3 ++-
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 9b3d7df..374cf81 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -82,7 +82,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const 
char *device)
                return NULL;
        }
 
-       ret = btrfs_scan_fs_devices(fd, device, &fs_devices);
+       ret = btrfs_scan_fs_devices(fd, device, &fs_devices, 0);
        if (ret)
                goto out;
 
diff --git a/cmds-chunk.c b/cmds-chunk.c
index 03314de..6ada328 100644
--- a/cmds-chunk.c
+++ b/cmds-chunk.c
@@ -1291,7 +1291,7 @@ static int recover_prepare(struct recover_control *rc, 
char *path)
                goto fail_free_sb;
        }
 
-       ret = btrfs_scan_fs_devices(fd, path, &fs_devices);
+       ret = btrfs_scan_fs_devices(fd, path, &fs_devices, 0);
        if (ret)
                goto fail_free_sb;
 
diff --git a/disk-io.c b/disk-io.c
index 13dbe27..1b91de6 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -909,13 +909,17 @@ void btrfs_cleanup_all_caches(struct btrfs_fs_info 
*fs_info)
 }
 
 int btrfs_scan_fs_devices(int fd, const char *path,
-                         struct btrfs_fs_devices **fs_devices)
+                         struct btrfs_fs_devices **fs_devices,
+                         u64 super_bytenr)
 {
        u64 total_devs;
        int ret;
 
+       if (super_bytenr == 0)
+               super_bytenr = BTRFS_SUPER_INFO_OFFSET;
+
        ret = btrfs_scan_one_device(fd, path, fs_devices,
-                                   &total_devs, BTRFS_SUPER_INFO_OFFSET);
+                                   &total_devs, super_bytenr);
        if (ret) {
                fprintf(stderr, "No valid Btrfs found on %s\n", path);
                return ret;
@@ -1001,7 +1005,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, 
const char *path,
        if (restore)
                fs_info->on_restoring = 1;
 
-       ret = btrfs_scan_fs_devices(fp, path, &fs_devices);
+       ret = btrfs_scan_fs_devices(fp, path, &fs_devices, sb_bytenr);
        if (ret)
                goto out;
 
diff --git a/disk-io.h b/disk-io.h
index effaa9f..d7792e0 100644
--- a/disk-io.h
+++ b/disk-io.h
@@ -59,7 +59,8 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info,
 void btrfs_release_all_roots(struct btrfs_fs_info *fs_info);
 void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info);
 int btrfs_scan_fs_devices(int fd, const char *path,
-                         struct btrfs_fs_devices **fs_devices);
+                         struct btrfs_fs_devices **fs_devices,
+                         u64 super_bytenr);
 int btrfs_setup_chunk_tree_and_device_map(struct btrfs_fs_info *fs_info);
 
 struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes);

++++++ btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch ++++++
>From d37ac57247379f929cd25cc1388c3df8830d704d Mon Sep 17 00:00:00 2001
From: David Sterba <dste...@suse.cz>
Date: Mon, 26 Mar 2012 14:50:48 +0200
Subject: [PATCH 8/8] btrfs-progs: use IEEE1541 suffixes for sizes

IEEE 1541-2002

Signed-off-by: David Sterba <dste...@suse.cz>
---
 utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils.c b/utils.c
index f885307..97e0da7 100644
--- a/utils.c
+++ b/utils.c
@@ -1094,8 +1094,8 @@ out:
        return ret;
 }
 
-static char *size_strs[] = { "", "KB", "MB", "GB", "TB",
-                           "PB", "EB", "ZB", "YB"};
+static char *size_strs[] = { "", "KiB", "MiB", "GiB", "TiB",
+                           "PiB", "EiB", "ZiB", "YiB"};
 char *pretty_sizes(u64 size)
 {
        int num_divs = 0;
-- 
1.7.6.233.gd79bc

++++++ 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="v0.20-rc1"
+v="v0.20-rc1+20130701"
 
 which git &> /dev/null
 if [ $? == 0 -a -d .git ]; then
++++++ setup-btrfs.sh ++++++
#!/bin/bash
#
#%stage: filesystem

mkdir -p $tmp_mnt/etc/udev/rules.d
cp /usr/lib/udev/rules.d/80-btrfs.rules $tmp_mnt/etc/udev/rules.d
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to