Hello community,

here is the log from the commit of package btrfsprogs.12255 for 
openSUSE:Leap:15.1:Update checked in at 2020-04-08 18:17:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.1:Update/btrfsprogs.12255 (Old)
 and      /work/SRC/openSUSE:Leap:15.1:Update/.btrfsprogs.12255.new.3248 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "btrfsprogs.12255"

Wed Apr  8 18:17:39 2020 rev:1 rq:791211 version:4.19.1

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

--- /dev/null   2020-04-01 01:12:57.297512941 +0200
+++ 
/work/SRC/openSUSE:Leap:15.1:Update/.btrfsprogs.12255.new.3248/btrfsprogs.changes
   2020-04-08 18:17:40.477408055 +0200
@@ -0,0 +1,1863 @@
+-------------------------------------------------------------------
+Fri Feb  7 10:14:26 UTC 2020 - Libor Pechacek <lpecha...@suse.com>
+
+- btrfs-progs: check: fix segfault with -Q (bsc#1158560)
+- Added patches:
+  * btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch
+
+-------------------------------------------------------------------
+Wed Jul 24 14:51:09 UTC 2019 - je...@suse.com
+
+- btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny
+  metadata (bsc#1131334).
+- Added patches:
+  * 
btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch
+
+-------------------------------------------------------------------
+Mon Mar 25 22:26:49 UTC 2019 - Mark Fasheh <mfas...@suse.com>
+
+- Use correct path for dracut-fsck-help.txt in module-setup.sh (bsc#1122539)
+ * Remove module-setup.sh
+ * Add module-setup.sh.in
+
+-------------------------------------------------------------------
+Fri Jan 25 00:06:04 UTC 2019 - mfas...@suse.com
+
+- Advise user of fs recovery options when we fail to mount (fate#320443,
+  bsc#1122539)
+ * Add dracut-fsck-help.txt
+ * Add module-setup.sh
+
+-------------------------------------------------------------------
+Fri Dec  7 07:57:07 UTC 2018 - nbori...@suse.com
+
+- Implement fate#325871
+       * Added 0001-btrfs-progs-Add-support-for-metadata_uuid-field.patch
+       * Added 0002-btrfs-progs-btrfstune-Add-support-for-changing-the-u.patch
+       * Added 0003-btrfs-progs-Remove-fsid-metdata_uuid-fields-from-fs_.patch
+       * Added 0004-btrfs-progs-Remove-btrfs_fs_info-new_fsid.patch
+       * Added 0005-btrfs-progs-Directly-pass-root-to-change_devices_uui.patch
+
+-------------------------------------------------------------------
+Thu Dec  6 00:00:00 CET 2018 - dste...@suse.cz
+
+- update to version 4.19.1
+  * check
+    * many lowmem mode improvements
+    * properly report qgroup mismatch errors
+    * check symlinks with append/immutable flags
+  * fi usage
+    * correctly calculate allocated/unallocated for raid10
+    * minor output updates
+  * mkfs
+    * detect ENOSPC on thinly provisioned devices
+    * fix spurious EEXIST during directory traversal
+  * restore: fix relative path for restore target
+  * dump-tree: print symbolic tree names for backrefs
+  * send: fix regression preventing send -p with subvolumes mounted on "/"
+  * corrupt-tree: refactoring and command line updates
+  * build
+    * make it work with e2fsprogs < 1.42 again
+    * restore support for autoconf 2.63
+    * detect if -std=gnu90 is supported
+  * other
+    * new tests
+    * cleanups
+
+-------------------------------------------------------------------
+Mon Nov 12 00:00:00 CET 2018 - dste...@suse.cz
+
+- update to version 4.19
+  * check: support repair of fs with free-space-tree feature
+  * core:
+    * port delayed ref infrastructure from kernel
+    * support write to free space tree
+  * dump-tree: new options for BFS and DFS enumeration of b-trees
+  * quota: rescan is now done automatically after 'assign'
+  * btrfstune: incomplete fix to uuid change
+  * subvol: fix 255 char limit checks
+  * completion: complete block devices and now regular files too
+  * docs:
+    * ship uncompressed manual pages
+    * btrfsck uses a manual page link instead of symlink
+  * other
+    * improved error handling
+    * docs
+    * new tests
+
+-------------------------------------------------------------------
+Mon Aug  6 00:00:00 CEST 2018 - dste...@suse.cz
+
+- update to version 4.17.1
+  * check:
+    * add ability to fix wrong ram_bytes for compressed inline files
+    * beautify progress output
+  * btrfstune: allow to continue uuid change after unclean interruption
+  * several fuzz fixes:
+    * detect overalpping chunks
+    * chunk loading error handling
+    * don't crash with unexpected root refs to extents
+  * relax option parsing again to allow mixing options and non-options
+    arguments
+  * fix qgroup rescan status reporting
+  * build:
+    * drop obsolete dir-test
+    * new configure option to disable building of tools
+    * add compatibility options --disable-static and --disable-shared
+  * other:
+    * cleanups and preparatory work
+    * new test images
+- spec cleanup
+
+-------------------------------------------------------------------
+Fri Jun 22 00:00:00 CEST 2018 - dste...@suse.cz
+
+- update to version 4.17
+  * check
+    * many lowmem mode improvements
+    * properly report qgroup mismatch errors
+    * check symlinks with append/immutable flags
+  * fi usage
+    * correctly calculate allocated/unallocated for raid10
+    * minor output updates
+  * mkfs
+    * detect ENOSPC on thinly provisioned devices
+    * fix spurious EEXIST during directory traversal
+  * restore: fix relative path for restore target
+  * dump-tree: print symbolic tree names for backrefs
+  * send: fix regression preventing send -p with subvolumes mounted on "/"
+  * corrupt-tree: refactoring and command line updates
+  * build
+    * make it work with e2fsprogs < 1.42 again
+    * restore support for autoconf 2.63
+    * detect if -std=gnu90 is supported
+- Removed patches (upstreamed):
+  * 0001-btrfs-progs-convert-fix-support-for-e2fsprogs-1.42.patch
+  * 0002-btrfs-progs-build-autoconf-2.63-compatibility.patch
+  * 0003-btrfs-progs-build-detect-whether-std-gnu90-is-suppor.patch
+
+-------------------------------------------------------------------
+Mon Apr 30 14:39:07 UTC 2018 - je...@suse.com
+
+- Fix building on SLE11:
+  * btrfs-progs: convert: fix support for e2fsprogs < 1.42
+  * btrfs-progs: build: detect whether -std=gnu90 is supported
+  * btrfs-progs: build: autoconf 2.63 compatibility
+  * Fixed mismerged addition of libbtrfsutil1 package description
+- Added patches:
+  * 0001-btrfs-progs-convert-fix-support-for-e2fsprogs-1.42.patch
+  * 0002-btrfs-progs-build-autoconf-2.63-compatibility.patch
+  * 0003-btrfs-progs-build-detect-whether-std-gnu90-is-suppor.patch
+
+-------------------------------------------------------------------
+Tue Apr 24 00:00:00 CEST 2018 - dste...@suse.cz
+
+- update to version 4.16.1
+  * remove obsolete tools: btrfs-debug-tree, btrfs-zero-log, btrfs-show-super,
+    btrfs-calc-size
+  * sb-mod: new debugging tool to edit superblock items
+  * mkfs: detect if thin-provisioned device does not have enough space
+  * check: don't try to verify checksums on metadata dump images
+  * build: fail documentation build if xmlto is not found
+  * build: fix build of btrfs.static
+- Remove patch: 0001-btrfs-progs-build-fix-static-build.patch (upstream)
+- Update initrd script
+
+-------------------------------------------------------------------
+Fri Apr  6 00:00:00 CEST 2018 - dste...@suse.cz
+
+- update to version 4.16
+  * libbtrfsutil - new LGPL library to wrap userspace functionality
+    * several 'btrfs' commands converted to use it:
+      * properties
+      * filesystem sync
+      * subvolume set-default/get-default/delete/show/sync
+    * python bindings, tests
+  * build
+    * use configured pkg-config path
+    * CI: add python, musl/clang, built dependencies caching
+    * convert: build fix for e2fsprogs 1.44+
+    * don't install library links with wrong permissions
+  * fixes
+    * prevent incorrect use of subvol_strip_mountpoint
+    * dump-super: don't verify csum for unknown type
+    * convert: fix inline extent creation condition
+  * check:
+    * lowmem: fix false alert for 'data extent backref lost for snapshot'
+    * lowmem: fix false alert for orphan inode
+    * lowmem: fix false alert for shared prealloc extents
+  * mkfs:
+    * add UUID and otime to root of FS_TREE - with the uuid, snapshots will
+      be now linked to the toplevel subvol by the parent UUID
+    * don't follow symlinks when calculating size
+    * pre-create the UUID tree
+    * fix --rootdir with selinux enabled
+  * dump-tree: add option to print only children nodes of a given block
+  * image: handle missing device for RAID1
+  * other
++++ 1666 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.1:Update/.btrfsprogs.12255.new.3248/btrfsprogs.changes

New:
----
  0001-btrfs-progs-Add-support-for-metadata_uuid-field.patch
  0002-btrfs-progs-btrfstune-Add-support-for-changing-the-u.patch
  0003-btrfs-progs-Remove-fsid-metdata_uuid-fields-from-fs_.patch
  0004-btrfs-progs-Remove-btrfs_fs_info-new_fsid.patch
  0005-btrfs-progs-Directly-pass-root-to-change_devices_uui.patch
  boot-btrfs.sh
  
btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch
  btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch
  btrfs-progs-v4.19.1.tar.gz
  btrfsprogs.changes
  btrfsprogs.spec
  dracut-fsck-help.txt
  mkfs-default-features.patch
  module-setup.sh.in
  setup-btrfs.sh
  sles11-defaults.h

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

Other differences:
------------------
++++++ btrfsprogs.spec ++++++
#
# spec file for package btrfsprogs
#
# Copyright (c) 2018 SUSE LINUX 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 https://bugs.opensuse.org/
#


%define udev_with_btrfs_builtin 190
%define udev_version %(rpm -q --queryformat %%{VERSION} udev)
%define package_udev_rules %{udev_version} >= %{udev_with_btrfs_builtin}

# enable building of btrfsprogs-static
%if 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1315
%define build_static    0
%else
# temporarily disable until libzstd-devel-static
%define build_static    0
%endif

# the tarball contains prebuilt documentation
%define build_docs      0

%define package_libbtrfsutil    0

%define _dracutmodulesdir %{_libexecdir}/dracut/modules.d

Name:           btrfsprogs
Version:        4.19.1
Release:        0
Summary:        Utilities for the Btrfs filesystem
License:        GPL-2.0
Group:          System/Filesystems
Url:            http://btrfs.wiki.kernel.org/index.php/Main_Page
#Git-Web:       
http://git.kernel.org/cgit/linux/kernel/git/kdave/btrfs-progs.git
#Git-Clone:     git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs
Source:         
https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v%{version}.tar.gz
# support for mkinitrd in < 13.1
Source1:        boot-btrfs.sh
Source2:        module-setup.sh.in
Source3:        dracut-fsck-help.txt
Source4:        setup-btrfs.sh
Source5:        sles11-defaults.h

Patch1:         mkfs-default-features.patch
Patch2:         0001-btrfs-progs-Add-support-for-metadata_uuid-field.patch
Patch3:         0002-btrfs-progs-btrfstune-Add-support-for-changing-the-u.patch
Patch4:         0003-btrfs-progs-Remove-fsid-metdata_uuid-fields-from-fs_.patch
Patch5:         0004-btrfs-progs-Remove-btrfs_fs_info-new_fsid.patch
Patch6:         0005-btrfs-progs-Directly-pass-root-to-change_devices_uui.patch
Patch7:         
btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch
Patch8:         btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch

%if %build_docs
BuildRequires:  asciidoc
%endif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  dracut
BuildRequires:  libattr-devel
BuildRequires:  libblkid-devel
BuildRequires:  libext2fs-devel
BuildRequires:  libreiserfscore-devel >= 3.6.27
Requires:       libreiserfscore0 >= 3.6.27
BuildRequires:  libuuid-devel
%if 0%{?suse_version} > 1500
BuildRequires:  libzstd-devel
%endif
BuildRequires:  lzo-devel
BuildRequires:  pkg-config
%if 0%{?suse_version} >= 1310
BuildRequires:  suse-module-tools
%endif
BuildRequires:  udev
%if 0%{?suse_version} == 1310
BuildRequires:  libudev-devel
%endif
%if %build_docs
BuildRequires:  xmlto
%endif
BuildRequires:  zlib-devel
%if 0%{?suse_version} >= 1310
Requires(post): coreutils
Requires(postun): coreutils
%endif
Supplements:    filesystem(btrfs)
Recommends:     btrfsmaintenance
%if %{package_udev_rules}
Requires:       btrfsprogs-udev-rules
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%if %build_static
%package -n btrfsprogs-static
Summary:        Static build of utilities for the Btrfs filesystem
Group:          System/Filesystems
BuildRequires:  glibc-devel-static
BuildRequires:  libblkid-devel-static
BuildRequires:  libcom_err-devel-static
BuildRequires:  libext2fs-devel-static
BuildRequires:  libuuid-devel-static
BuildRequires:  lzo-devel-static
BuildRequires:  zlib-devel-static

%description -n btrfsprogs-static
Static build of utilities needed to create and maintain btrfs file systems
under Linux. Suitable for limited or rescue environments.

Warning: the zlib and lzo libraries are statically linked in and may lack
important updates
%endif

%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}
Requires:       libbtrfs0 = %{version}

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

# rpm < 4.6.0 (SLE11 uses 4.4) doesn't support noarch subpackages.
# Fortunately, it doesn't use systemd either so we can just skip it.
%if %{package_udev_rules}
%package udev-rules
Summary:        Udev rules for configuring btrfs file systems
Group:          System/Kernel
Conflicts:      udev < %{udev_with_btrfs_builtin}
BuildArch:      noarch

%description udev-rules
This package contains the udev rule file for configuring device mapper
devices that are components of btrfs file systems.  It is meant to be
used with versions of udev that contain the "built-in" btrfs command
(v190 and newer).  Older versions of udev will call the version of
"btrfs ready" contained in the btrfsprogs package, which does the right
thing.
%endif

%if 0%{package_libbtrfsutil}

%package -n libbtrfsutil1
Summary:        Utility library for interacting with Btrfs
Group:          System/Libraries

%description -n libbtrfsutil1
This package contains the libbtrfsutil.so shared library. This library is
LGPL unlike libbtrfs.so and can be used by applications to interact with Btrfs
filesystems.

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

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

%endif

%prep
%setup -q -n btrfs-progs-v%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

%build
./autogen.sh
%if 0%{?suse_version} == 1110
cp %{SOURCE5} .
export CFLAGS="%{optflags} -include sles11-defaults.h"
%endif

%configure                      \
                        --disable-python        \
%if !%{build_docs}
                        --disable-documentation \
%endif
%if 0%{?suse_version} <= 1500
                        --disable-zstd
%endif

make V=1 %{?_smp_mflags} all \
%if %{build_static}
                        static
%endif

%install
make install            \
%if %{build_static}
        install-static  \
%endif
        DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} 
mandir=%{_mandir} libdir=%{_libdir}

%if !%{build_docs}
cd Documentation
install -m 0755 -d %{buildroot}/%{_mandir}/man5
install -m 0755 -d %{buildroot}/%{_mandir}/man8
install -m 0644 *.5 %{buildroot}/%{_mandir}/man5
install -m 0644 *.8 %{buildroot}/%{_mandir}/man8
cd ..
%endif

%if %{build_static}
make install-static DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_sbindir} 
mandir=%{_mandir} libdir=%{_libdir}
%endif

install -m 0755 -d %{buildroot}/%{_sbindir}
install -m 0755 -d %{buildroot}/%{_bindir}
# move some utilities out of /usr/sbin
mv %{buildroot}/%{_sbindir}/btrfs-map-logical %{buildroot}/%{_bindir}
# initrd rescue utilities
install -m 0755 btrfs-select-super %{buildroot}/%{_sbindir}
install -m 0755 btrfs-image %{buildroot}/%{_sbindir}
install -m 0755 btrfstune %{buildroot}/%{_sbindir}
install -m 0755 btrfs-find-root %{buildroot}/%{_sbindir}
install -m 0755 -d %{buildroot}/sbin
ln -s %{_sbindir}/btrfs %{buildroot}/sbin
ln -s %{_sbindir}/btrfs-convert %{buildroot}/sbin
ln -s %{_sbindir}/btrfs-select-super %{buildroot}/sbin
ln -s %{_sbindir}/btrfs-image %{buildroot}/sbin
ln -s %{_sbindir}/btrfstune %{buildroot}/sbin
ln -s %{_sbindir}/btrfsck %{buildroot}/sbin
ln -s %{_sbindir}/btrfs-find-root %{buildroot}/sbin
ln -s %{_sbindir}/mkfs.btrfs %{buildroot}/sbin
ln -s %{_sbindir}/fsck.btrfs %{buildroot}/sbin
%if 0%{?suse_version} < 1310
install -d -m0755 %{buildroot}/lib/mkinitrd/scripts/
install -m 0755 %{SOURCE1} %{buildroot}/lib/mkinitrd/scripts/
install -m 0755 %{SOURCE4} %{buildroot}/lib/mkinitrd/scripts/
%endif
# don't install .a for now
rm -f %{buildroot}/%{_libdir}/*.a
# bash completion
install -m 0755 -d %{buildroot}/%{_datadir}/bash-completion/completions
install -m 0644 btrfs-completion 
%{buildroot}/%{_datadir}/bash-completion/completions/btrfs
sed -e 's,@@INSTALLDIR@@,%{_datadir}/%{name}/,;' %{SOURCE2} > module-setup.sh
install -m 0755 -D module-setup.sh 
%{buildroot}/%{_dracutmodulesdir}/95suse-btrfs/module-setup.sh
rm -f module-setup.sh
install -m 0644 -D %{SOURCE3} 
%{buildroot}/%{_datadir}/%{name}/dracut-fsck-help.txt

%if 0%{package_libbtrfsutil}
%else
rm -f %{buildroot}/%{_libdir}/libbtrfsutil.so*
rm -f %{buildroot}/%{_includedir}/btrfsutil.h
%endif

%if 0%{!?for_debugging:1}
DEBUG_FILES="/sbin/btrfs-find-root
  %{_sbindir}/btrfs-find-root
  %{_mandir}/man8/btrfs-find-root.8
  /sbin/btrfs-select-super
  %{_sbindir}/btrfs-select-super"
for file in $DEBUG_FILES; do
  rm -f %{buildroot}$file
done
%endif

%post -n libbtrfs0 -p /sbin/ldconfig

%postun -n libbtrfs0 -p /sbin/ldconfig

%if 0%{package_libbtrfsutil}
%post -n libbtrfsutil1 -p /sbin/ldconfig

%postun -n libbtrfsutil1 -p /sbin/ldconfig
%endif

%if 0%{?suse_version} >= 1310
%post
%{?regenerate_initrd_post}

%postun
%{?regenerate_initrd_post}

%posttrans
%{?regenerate_initrd_posttrans}
%endif

%files
%defattr(-, root, root)
%doc COPYING
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/dracut-fsck-help.txt
%dir %{_dracutmodulesdir}/95suse-btrfs/
%{_dracutmodulesdir}/95suse-btrfs/module-setup.sh
/sbin/fsck.btrfs
# mkinitrd utils
/sbin/btrfs
/sbin/btrfs-convert
/sbin/btrfs-image
/sbin/btrfstune
/sbin/btrfsck
/sbin/mkfs.btrfs
%{_sbindir}/btrfs
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-image
%{_sbindir}/btrfstune
%{_sbindir}/btrfsck
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%if 0%{?suse_version} < 1310
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/boot-btrfs.sh
/lib/mkinitrd/scripts/setup-btrfs.sh
%endif
%{_bindir}/btrfs-map-logical
%{_mandir}/man8/btrfs-image.8%{?ext_man}
%{_mandir}/man8/btrfsck.8%{?ext_man}
%{_mandir}/man8/fsck.btrfs.8%{?ext_man}
%{_mandir}/man8/mkfs.btrfs.8%{?ext_man}
%{_mandir}/man8/btrfs.8%{?ext_man}
%{_mandir}/man5/btrfs.5%{?ext_man}
%{_mandir}/man8/btrfs-convert.8%{?ext_man}
%{_mandir}/man8/btrfs-map-logical.8%{?ext_man}
%{_mandir}/man8/btrfstune.8%{?ext_man}
%{_mandir}/man8/btrfs-balance.8%{?ext_man}
%{_mandir}/man8/btrfs-check.8%{?ext_man}
%{_mandir}/man8/btrfs-device.8%{?ext_man}
%{_mandir}/man8/btrfs-filesystem.8%{?ext_man}
%{_mandir}/man8/btrfs-inspect-internal.8%{?ext_man}
%{_mandir}/man8/btrfs-property.8%{?ext_man}
%{_mandir}/man8/btrfs-qgroup.8%{?ext_man}
%{_mandir}/man8/btrfs-quota.8%{?ext_man}
%{_mandir}/man8/btrfs-receive.8%{?ext_man}
%{_mandir}/man8/btrfs-replace.8%{?ext_man}
%{_mandir}/man8/btrfs-rescue.8%{?ext_man}
%{_mandir}/man8/btrfs-restore.8%{?ext_man}
%{_mandir}/man8/btrfs-scrub.8%{?ext_man}
%{_mandir}/man8/btrfs-send.8%{?ext_man}
%{_mandir}/man8/btrfs-subvolume.8%{?ext_man}
%{_mandir}/man8/btrfs-select-super.8%{?ext_man}
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/btrfs

%if 0%{?for_debugging:1}
/sbin/btrfs-find-root
%{_sbindir}/btrfs-find-root
%{_mandir}/man8/btrfs-find-root.8%{?ext_man}
/sbin/btrfs-select-super
%{_sbindir}/btrfs-select-super
%endif

%if %{build_static}
%files -n btrfsprogs-static
%defattr(-, root, root)
%{_sbindir}/btrfs.static
%{_sbindir}/btrfs-convert.static
%{_sbindir}/btrfs-image.static
%{_sbindir}/btrfstune.static
%{_sbindir}/btrfsck.static
%{_sbindir}/mkfs.btrfs.static
%{_sbindir}/btrfs-corrupt-block.static
%{_sbindir}/btrfs-find-root.static
%{_sbindir}/btrfs-map-logical.static
%{_sbindir}/btrfs-select-super.static
%endif

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

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

%if 0%{package_libbtrfsutil}
%files -n libbtrfsutil1
%defattr(-, root, root)
%{_libdir}/libbtrfsutil.so.*

%files -n libbtrfsutil-devel
%defattr(-, root, root)
%{_includedir}/btrfsutil.h
%{_libdir}/libbtrfsutil.so
%endif

%if %{package_udev_rules}
%files udev-rules
%defattr(-, root, root)
%dir %{_udevrulesdir}
%{_udevrulesdir}/64-btrfs-dm.rules
%endif

%changelog
++++++ 0001-btrfs-progs-Add-support-for-metadata_uuid-field.patch ++++++
++++ 641 lines (skipped)

++++++ 0002-btrfs-progs-btrfstune-Add-support-for-changing-the-u.patch ++++++
>From 9afa70a4087f42c529cc93253d7144f220f007f3 Mon Sep 17 00:00:00 2001
From: Nikolay Borisov <nbori...@suse.com>
Date: Thu, 11 Oct 2018 18:04:00 +0300
Subject: [PATCH 2/6] btrfs-progs: btrfstune: Add support for changing the user
 uuid

This allows us to change the use-visible UUID on filesytems from
userspace if desired, by copying the existing UUID to the new location
for metadata comparisons. If this is done, an incompat flag must be
set to prevent older filesystems from mounting the filesystem, but
the original UUID can be restored, and the incompat flag removed.

This introduces the new -m|-M UUID options similar to current
-u|-U UUID ones with the difference that we don't rewrite the fsid but
just copy the old uuid and set a new one. Additionally running with
[-M old-uuid] clears the incompat flag and retains only fsid on-disk.

Additionally it's not allowed to intermix -m/-u/-U/-M options in a
single invocation of btrfstune, nor is it allowed to change the uuid
while there is a uuid rewrite in-progress. Also changing the uuid of a
seed device is not currently allowed (can change in the future).

Example:

btrfstune -m /dev/loop1
btrfs inspect-internal dump-super /dev/loop1

superblock: bytenr=65536, device=/dev/loop1
---------------------------------------------------------
csum_type               0 (crc32c)
csum_size               4
csum                    0x4b7ea749 [match]

<ommitted for brevity>

fsid                    0efc41d3-4451-49f3-8108-7b8bdbcf5ae8
metadata_uuid           352715e7-62cf-4ae0-92ee-85a574adc318

<ommitted for brevity>

incompat_flags          0x541
                        ( MIXED_BACKREF |
                          EXTENDED_IREF |
                          SKINNY_METADATA |
                          METADATA_UUID )

<omitted for brevity>

dev_item.uuid           0610deee-dfc3-498b-9449-a06533cdec98
dev_item.fsid           352715e7-62cf-4ae0-92ee-85a574adc318 [match]

<ommitted for brevity>

mount /dev/loop1 btrfs-mnt/
btrfs fi show btrfs-mnt/

Label: none  uuid: 0efc41d3-4451-49f3-8108-7b8bdbcf5ae8
        Total devices 1 FS bytes used 128.00KiB
        devid    1 size 5.00GiB used 536.00MiB path /dev/loop1

In this case a new btrfs filesystem was created and the original uuid
was 352715e7-62cf-4ae0-92ee-85a574adc318, then btrfstune was run which
copied that value over to metadata_uuid field and set the current fsid
to 0efc41d3-4451-49f3-8108-7b8bdbcf5ae8. And as far as userspace is
concerned this is the fsid of the fs.

Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
---
 btrfstune.c | 185 +++++++++++++++++++++++++++++++++++++++++++++-------
 ctree.h     |   1 +
 2 files changed, 161 insertions(+), 25 deletions(-)

diff --git a/btrfstune.c b/btrfstune.c
index ad70772b6962..b6ce201155f7 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -73,6 +73,116 @@ static int update_seeding_flag(struct btrfs_root *root, int 
set_flag)
        return ret;
 }
 
+/*
+ * Return 0 for no unfinished fsid change.
+ * Return >0 for unfinished fsid change, and restore unfinished fsid/
+ * chunk_tree_id into fsid_ret/chunk_id_ret.
+ */
+static int check_unfinished_fsid_change(struct btrfs_fs_info *fs_info,
+                                       uuid_t fsid_ret, uuid_t chunk_id_ret)
+{
+       struct btrfs_root *tree_root = fs_info->tree_root;
+       u64 flags = btrfs_super_flags(fs_info->super_copy);
+
+       if (flags & (BTRFS_SUPER_FLAG_CHANGING_FSID |
+                    BTRFS_SUPER_FLAG_CHANGING_FSID_V2)) {
+               memcpy(fsid_ret, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
+               read_extent_buffer(tree_root->node, chunk_id_ret,
+                               btrfs_header_chunk_tree_uuid(tree_root->node),
+                               BTRFS_UUID_SIZE);
+               return 1;
+       }
+       return 0;
+}
+
+static int set_metadata_uuid(struct btrfs_root *root, const char *uuid_string)
+{
+       struct btrfs_super_block *disk_super;
+       uuid_t new_fsid, unused1, unused2;
+       struct btrfs_trans_handle *trans;
+       bool new_uuid = true;
+       u64 incompat_flags;
+       bool uuid_changed;
+       u64 super_flags;
+       int ret;
+
+       disk_super = root->fs_info->super_copy;
+       super_flags = btrfs_super_flags(disk_super);
+       incompat_flags = btrfs_super_incompat_flags(disk_super);
+       uuid_changed = incompat_flags & BTRFS_FEATURE_INCOMPAT_METADATA_UUID;
+
+       if (super_flags & BTRFS_SUPER_FLAG_SEEDING) {
+               fprintf(stderr, "Cannot set metadata UUID on a seed device\n");
+               return 1;
+       }
+
+       if (check_unfinished_fsid_change(root->fs_info, unused1, unused2)) {
+               fprintf(stderr, "UUID rewrite in progress, cannot change "
+                       "fsid\n");
+               return 1;
+       }
+
+       if (uuid_string)
+               uuid_parse(uuid_string, new_fsid);
+       else
+               uuid_generate(new_fsid);
+
+       new_uuid = (memcmp(new_fsid, disk_super->fsid, BTRFS_FSID_SIZE) != 0);
+
+       /* Step 1 sets the in progress flag */
+       trans = btrfs_start_transaction(root, 1);
+       super_flags |= BTRFS_SUPER_FLAG_CHANGING_FSID_V2;
+       btrfs_set_super_flags(disk_super, super_flags);
+       ret = btrfs_commit_transaction(trans, root);
+       if (ret < 0)
+               return ret;
+
+       if (new_uuid && uuid_changed && memcmp(disk_super->metadata_uuid,
+                                              new_fsid, BTRFS_FSID_SIZE) == 0) 
{
+               /*
+                * Changing fsid to be the same as metadata uuid, so just
+                * disable the flag
+                */
+               memcpy(disk_super->fsid, &new_fsid, BTRFS_FSID_SIZE);
+               incompat_flags &= ~BTRFS_FEATURE_INCOMPAT_METADATA_UUID;
+               btrfs_set_super_incompat_flags(disk_super, incompat_flags);
+               memset(disk_super->metadata_uuid, 0, BTRFS_FSID_SIZE);
+       } else if (new_uuid && uuid_changed && memcmp(disk_super->metadata_uuid,
+                                               new_fsid, BTRFS_FSID_SIZE)) {
+               /*
+                * Changing fsid on an already changed FS, in this case we
+                * only change the fsid and don't touch metadata uuid as it
+                * has already the correct value
+                */
+               memcpy(disk_super->fsid, &new_fsid, BTRFS_FSID_SIZE);
+       } else if (new_uuid && !uuid_changed) {
+               /*
+                * First time changing the fsid, copy the fsid to metadata_uuid
+                */
+               incompat_flags |= BTRFS_FEATURE_INCOMPAT_METADATA_UUID;
+               btrfs_set_super_incompat_flags(disk_super, incompat_flags);
+               memcpy(disk_super->metadata_uuid, disk_super->fsid,
+                      BTRFS_FSID_SIZE);
+               memcpy(disk_super->fsid, &new_fsid, BTRFS_FSID_SIZE);
+       } else {
+               /* Setting the same fsid as current, do nothing */
+               return 0;
+       }
+
+       trans = btrfs_start_transaction(root, 1);
+
+       /*
+        * Step 2 is to write the metadata_uuid, set the incompat flag and
+        * clear the in progress flag
+        */
+       super_flags &= ~BTRFS_SUPER_FLAG_CHANGING_FSID_V2;
+       btrfs_set_super_flags(disk_super, super_flags);
+
+       /* Then actually copy the metadata uuid and set the incompat bit */
+
+       return btrfs_commit_transaction(trans, root);
+}
+
 static int set_super_incompat_flags(struct btrfs_root *root, u64 flags)
 {
        struct btrfs_trans_handle *trans;
@@ -268,26 +378,6 @@ static int change_fsid_done(struct btrfs_fs_info *fs_info)
        return write_all_supers(fs_info);
 }
 
-/*
- * Return 0 for no unfinished fsid change.
- * Return >0 for unfinished fsid change, and restore unfinished fsid/
- * chunk_tree_id into fsid_ret/chunk_id_ret.
- */
-static int check_unfinished_fsid_change(struct btrfs_fs_info *fs_info,
-                                       uuid_t fsid_ret, uuid_t chunk_id_ret)
-{
-       struct btrfs_root *tree_root = fs_info->tree_root;
-       u64 flags = btrfs_super_flags(fs_info->super_copy);
-
-       if (flags & BTRFS_SUPER_FLAG_CHANGING_FSID) {
-               memcpy(fsid_ret, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
-               read_extent_buffer(tree_root->node, chunk_id_ret,
-                               btrfs_header_chunk_tree_uuid(tree_root->node),
-                               BTRFS_UUID_SIZE);
-               return 1;
-       }
-       return 0;
-}
 
 /*
  * Change fsid of a given fs.
@@ -381,8 +471,10 @@ static void print_usage(void)
        printf("\t-x \t\tenable skinny metadata extent refs\n");
        printf("\t-n \t\tenable no-holes feature (more efficient sparse file 
representation)\n");
        printf("\t-f \t\tforce to do dangerous operation, make sure that you 
are aware of the dangers\n");
-       printf("\t-u \t\tchange fsid, use a random one\n");
-       printf("\t-U UUID\t\tchange fsid to UUID\n");
+       printf("\t-u \t\trewrite fsid, use a random one\n");
+       printf("\t-U UUID\t\trewrite fsid to UUID\n");
+       printf("\t-m \t\tchange only user-facing uuid (more lightweight than 
-u|-U)\n");
+       printf("\t-M UUID\t\tchange fsid to UUID\n");
 }
 
 int main(int argc, char *argv[])
@@ -394,6 +486,7 @@ int main(int argc, char *argv[])
        int seeding_flag = 0;
        u64 seeding_value = 0;
        int random_fsid = 0;
+       int change_metadata_uuid = 0;
        char *new_fsid_str = NULL;
        int ret;
        u64 super_flags = 0;
@@ -404,7 +497,7 @@ int main(int argc, char *argv[])
                        { "help", no_argument, NULL, GETOPT_VAL_HELP},
                        { NULL, 0, NULL, 0 }
                };
-               int c = getopt_long(argc, argv, "S:rxfuU:n", long_options, 
NULL);
+               int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, 
NULL);
 
                if (c < 0)
                        break;
@@ -433,6 +526,15 @@ int main(int argc, char *argv[])
                        ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH;
                        random_fsid = 1;
                        break;
+               case 'M':
+                       ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH;
+                       change_metadata_uuid = 1;
+                       new_fsid_str = optarg;
+                       break;
+               case 'm':
+                       ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH;
+                       change_metadata_uuid = 1;
+                       break;
                case GETOPT_VAL_HELP:
                default:
                        print_usage();
@@ -451,7 +553,8 @@ int main(int argc, char *argv[])
                error("random fsid can't be used with specified fsid");
                return 1;
        }
-       if (!super_flags && !seeding_flag && !(random_fsid || new_fsid_str)) {
+       if (!super_flags && !seeding_flag && !(random_fsid || new_fsid_str) &&
+           !change_metadata_uuid) {
                error("at least one option should be specified");
                print_usage();
                return 1;
@@ -498,6 +601,12 @@ int main(int argc, char *argv[])
        }
 
        if (seeding_flag) {
+               if (btrfs_fs_incompat(root->fs_info, METADATA_UUID)) {
+                       fprintf(stderr, "SEED flag cannot be changed on a 
metadata-uuid changed fs\n");
+                       ret = 1;
+                       goto out;
+               }
+
                if (!seeding_value && !force) {
                        warning(
 "this is dangerous, clearing the seeding flag may cause the derived device not 
to be mountable!");
@@ -522,7 +631,33 @@ int main(int argc, char *argv[])
                total++;
        }
 
-       if (random_fsid || new_fsid_str) {
+       if (change_metadata_uuid) {
+               if (seeding_flag) {
+                       fprintf(stderr,
+               "Not allowed to set both seeding flag and uuid metadata\n");
+                       ret = 1;
+                       goto out;
+               }
+
+               if (new_fsid_str)
+                       ret = set_metadata_uuid(root, new_fsid_str);
+               else
+                       ret = set_metadata_uuid(root, NULL);
+
+               if (!ret)
+                       success++;
+               total++;
+       }
+
+       if (random_fsid || (new_fsid_str && !change_metadata_uuid)) {
+               if (btrfs_fs_incompat(root->fs_info, METADATA_UUID)) {
+                       fprintf(stderr,
+               "Cannot rewrite fsid while METADATA_UUID flag is active. \n"
+               "Ensure fsid and metadata_uuid match before retrying.\n");
+                       ret = 1;
+                       goto out;
+               }
+
                if (!force) {
                        warning(
 "it's recommended to run 'btrfs check --readonly' before this operation.\n"
diff --git a/ctree.h b/ctree.h
index 45ef02e7fb45..be5ecf8fe7c1 100644
--- a/ctree.h
+++ b/ctree.h
@@ -330,6 +330,7 @@ static inline unsigned long btrfs_chunk_item_size(int 
num_stripes)
 #define BTRFS_SUPER_FLAG_METADUMP              (1ULL << 33)
 #define BTRFS_SUPER_FLAG_METADUMP_V2           (1ULL << 34)
 #define BTRFS_SUPER_FLAG_CHANGING_FSID         (1ULL << 35)
+#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2      (1ULL << 36)
 
 #define BTRFS_BACKREF_REV_MAX          256
 #define BTRFS_BACKREF_REV_SHIFT                56
-- 
2.17.1

++++++ 0003-btrfs-progs-Remove-fsid-metdata_uuid-fields-from-fs_.patch ++++++
>From 0e8e98121455f53a129c9fe825d465c6a7749e9b Mon Sep 17 00:00:00 2001
From: Nikolay Borisov <nbori...@suse.com>
Date: Thu, 11 Oct 2018 18:04:02 +0300
Subject: [PATCH 3/6] btrfs-progs: Remove fsid/metdata_uuid fields from fs_info

Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
---
 btrfstune.c       |  5 +++--
 check/main.c      |  2 +-
 chunk-recover.c   | 11 +++++------
 ctree.c           | 11 ++++++-----
 ctree.h           |  2 --
 disk-io.c         | 18 +++++++++---------
 free-space-tree.c |  5 +++--
 volumes.c         |  5 +++--
 8 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/btrfstune.c b/btrfstune.c
index b6ce201155f7..500308b556fe 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -359,7 +359,8 @@ static int change_fsid_prepare(struct btrfs_fs_info 
*fs_info)
                return ret;
 
        /* Also need to change the metadatauuid of the fs info */
-       memcpy(fs_info->metadata_uuid, fs_info->new_fsid, BTRFS_FSID_SIZE);
+       memcpy(fs_info->fs_devices->metadata_uuid, fs_info->new_fsid,
+              BTRFS_FSID_SIZE);
 
        /* also restore new chunk_tree_id into tree_root for restore */
        write_extent_buffer(tree_root->node, fs_info->new_chunk_tree_uuid,
@@ -416,7 +417,7 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const 
char *new_fsid_str)
        fs_info->new_fsid = new_fsid;
        fs_info->new_chunk_tree_uuid = new_chunk_id;
 
-       memcpy(old_fsid, (const char*)fs_info->fsid, BTRFS_UUID_SIZE);
+       memcpy(old_fsid, (const char*)fs_info->fs_devices->fsid, 
BTRFS_UUID_SIZE);
        uuid_unparse(old_fsid, uuid_buf);
        printf("Current fsid: %s\n", uuid_buf);
 
diff --git a/check/main.c b/check/main.c
index 915be1b5afd2..dbb7da5b1dc2 100644
--- a/check/main.c
+++ b/check/main.c
@@ -8424,7 +8424,7 @@ static int btrfs_fsck_reinit_root(struct 
btrfs_trans_handle *trans,
        btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV);
        btrfs_set_header_owner(c, root->root_key.objectid);
 
-       write_extent_buffer(c, root->fs_info->metadata_uuid,
+       write_extent_buffer(c, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        write_extent_buffer(c, root->fs_info->chunk_tree_uuid,
diff --git a/chunk-recover.c b/chunk-recover.c
index 31325bfc54e0..959c169f79a4 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -1155,7 +1155,7 @@ static int __rebuild_chunk_root(struct btrfs_trans_handle 
*trans,
        btrfs_set_header_level(cow, 0);
        btrfs_set_header_backref_rev(cow, BTRFS_MIXED_BACKREF_REV);
        btrfs_set_header_owner(cow, BTRFS_CHUNK_TREE_OBJECTID);
-       write_extent_buffer(cow, root->fs_info->metadata_uuid,
+       write_extent_buffer(cow, root->fs_info->fs_devices->metadata_uuid,
                        btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        write_extent_buffer(cow, root->fs_info->chunk_tree_uuid,
@@ -1457,7 +1457,7 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
                goto out_devices;
        }
 
-       memcpy(fs_info->fsid, &disk_super->fsid, BTRFS_FSID_SIZE);
+       ASSERT(!memcmp(disk_super->fsid, rc->fs_devices->fsid, 
BTRFS_FSID_SIZE));
        fs_info->sectorsize = btrfs_super_sectorsize(disk_super);
        fs_info->nodesize = btrfs_super_nodesize(disk_super);
        fs_info->stripesize = btrfs_super_stripesize(disk_super);
@@ -1469,10 +1469,9 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
        features = btrfs_super_incompat_flags(disk_super);
 
        if (features & BTRFS_FEATURE_INCOMPAT_METADATA_UUID)
-               memcpy(fs_info->metadata_uuid, disk_super->metadata_uuid,
-                      BTRFS_FSID_SIZE);
-       else
-               memcpy(fs_info->metadata_uuid, fs_info->fsid, BTRFS_FSID_SIZE);
+               ASSERT(!memcmp(disk_super->metadata_uuid,
+                              fs_info->fs_devices->metadata_uuid,
+                              BTRFS_FSID_SIZE));
 
        btrfs_setup_root(fs_info->chunk_root, fs_info,
                         BTRFS_CHUNK_TREE_OBJECTID);
diff --git a/ctree.c b/ctree.c
index 548d6e2c1f62..e7bb26e65c55 100644
--- a/ctree.c
+++ b/ctree.c
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "sizes.h"
 #include "messages.h"
+#include "volumes.h"
 
 static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
                      *root, struct btrfs_path *path, int level);
@@ -134,7 +135,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
        else
                btrfs_set_header_owner(cow, new_root_objectid);
 
-       write_extent_buffer(cow, root->fs_info->metadata_uuid,
+       write_extent_buffer(cow, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        WARN_ON(btrfs_header_generation(buf) > trans->transid);
@@ -308,7 +309,7 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans,
        else
                btrfs_set_header_owner(cow, root->root_key.objectid);
 
-       write_extent_buffer(cow, root->fs_info->metadata_uuid,
+       write_extent_buffer(cow, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        WARN_ON(!(buf->flags & EXTENT_BAD_TRANSID) &&
@@ -1548,7 +1549,7 @@ static int noinline insert_new_root(struct 
btrfs_trans_handle *trans,
 
        root_add_used(root, root->fs_info->nodesize);
 
-       write_extent_buffer(c, root->fs_info->metadata_uuid,
+       write_extent_buffer(c, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        write_extent_buffer(c, root->fs_info->chunk_tree_uuid,
@@ -1669,7 +1670,7 @@ static int split_node(struct btrfs_trans_handle *trans, 
struct btrfs_root
        btrfs_set_header_generation(split, trans->transid);
        btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV);
        btrfs_set_header_owner(split, root->root_key.objectid);
-       write_extent_buffer(split, root->fs_info->metadata_uuid,
+       write_extent_buffer(split, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
        write_extent_buffer(split, root->fs_info->chunk_tree_uuid,
                            btrfs_header_chunk_tree_uuid(split),
@@ -2251,7 +2252,7 @@ static noinline int split_leaf(struct btrfs_trans_handle 
*trans,
        btrfs_set_header_backref_rev(right, BTRFS_MIXED_BACKREF_REV);
        btrfs_set_header_owner(right, root->root_key.objectid);
        btrfs_set_header_level(right, 0);
-       write_extent_buffer(right, root->fs_info->metadata_uuid,
+       write_extent_buffer(right, root->fs_info->fs_devices->metadata_uuid,
                            btrfs_header_fsid(), BTRFS_FSID_SIZE);
 
        write_extent_buffer(right, root->fs_info->chunk_tree_uuid,
diff --git a/ctree.h b/ctree.h
index be5ecf8fe7c1..dec0dab1dde5 100644
--- a/ctree.h
+++ b/ctree.h
@@ -1093,8 +1093,6 @@ struct btrfs_block_group_cache {
 struct btrfs_device;
 struct btrfs_fs_devices;
 struct btrfs_fs_info {
-       u8 fsid[BTRFS_FSID_SIZE];
-       u8 metadata_uuid[BTRFS_FSID_SIZE];
        u8 *new_fsid;
        u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
        u8 *new_chunk_tree_uuid;
diff --git a/disk-io.c b/disk-io.c
index 1e5fac89b127..8ead97d079ac 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -118,7 +118,7 @@ static void print_tree_block_error(struct btrfs_fs_info 
*fs_info,
                read_extent_buffer(eb, buf, btrfs_header_fsid(),
                                   BTRFS_UUID_SIZE);
                uuid_unparse(buf, found_uuid);
-               uuid_unparse(fs_info->metadata_uuid, fs_uuid);
+               uuid_unparse(fs_info->fs_devices->metadata_uuid, fs_uuid);
                fprintf(stderr, "fsid mismatch, want=%s, have=%s\n",
                        fs_uuid, found_uuid);
                break;
@@ -1184,13 +1184,12 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, 
const char *path,
                goto out_devices;
        }
 
-       memcpy(fs_info->fsid, &disk_super->fsid, BTRFS_FSID_SIZE);
-       if (btrfs_fs_incompat(fs_info, METADATA_UUID)) {
-               memcpy(fs_info->metadata_uuid, disk_super->metadata_uuid,
-                      BTRFS_FSID_SIZE);
-       } else {
-               memcpy(fs_info->metadata_uuid, fs_info->fsid, BTRFS_FSID_SIZE);
-       }
+       ASSERT(!memcmp(disk_super->fsid, fs_devices->fsid, BTRFS_FSID_SIZE));
+       ASSERT(!memcmp(disk_super->fsid, fs_devices->fsid, BTRFS_FSID_SIZE));
+       if (btrfs_fs_incompat(fs_info, METADATA_UUID))
+               ASSERT(!memcmp(disk_super->metadata_uuid,
+                              fs_devices->metadata_uuid, BTRFS_FSID_SIZE));
+
        fs_info->sectorsize = btrfs_super_sectorsize(disk_super);
        fs_info->nodesize = btrfs_super_nodesize(disk_super);
        fs_info->stripesize = btrfs_super_stripesize(disk_super);
@@ -1646,7 +1645,8 @@ int write_all_supers(struct btrfs_fs_info *fs_info)
                btrfs_set_stack_device_io_width(dev_item, dev->io_width);
                btrfs_set_stack_device_sector_size(dev_item, dev->sector_size);
                memcpy(dev_item->uuid, dev->uuid, BTRFS_UUID_SIZE);
-               memcpy(dev_item->fsid, fs_info->metadata_uuid, BTRFS_FSID_SIZE);
+               memcpy(dev_item->fsid, fs_info->fs_devices->metadata_uuid,
+                      BTRFS_FSID_SIZE);
 
                flags = btrfs_super_flags(sb);
                btrfs_set_super_flags(sb, flags | BTRFS_HEADER_FLAG_WRITTEN);
diff --git a/free-space-tree.c b/free-space-tree.c
index 0a3305415657..2251b825890f 100644
--- a/free-space-tree.c
+++ b/free-space-tree.c
@@ -20,6 +20,7 @@
 #include "disk-io.h"
 #include "free-space-cache.h"
 #include "free-space-tree.h"
+#include "volumes.h"
 #include "transaction.h"
 #include "bitops.h"
 #include "internal.h"
@@ -1453,8 +1454,8 @@ static struct btrfs_root *btrfs_create_tree(struct 
btrfs_trans_handle *trans,
        btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV);
        btrfs_set_header_owner(leaf, objectid);
        root->node = leaf;
-       write_extent_buffer(leaf, fs_info->metadata_uuid, btrfs_header_fsid(),
-                           BTRFS_FSID_SIZE);
+       write_extent_buffer(leaf, fs_info->fs_devices->metadata_uuid,
+                           btrfs_header_fsid(), BTRFS_FSID_SIZE);
        write_extent_buffer(leaf, fs_info->chunk_tree_uuid,
                            btrfs_header_chunk_tree_uuid(leaf),
                            BTRFS_UUID_SIZE);
diff --git a/volumes.c b/volumes.c
index 6ef871637d7a..2c6aaf42c5fb 100644
--- a/volumes.c
+++ b/volumes.c
@@ -741,7 +741,8 @@ int btrfs_add_device(struct btrfs_trans_handle *trans,
        ptr = (unsigned long)btrfs_device_uuid(dev_item);
        write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE);
        ptr = (unsigned long)btrfs_device_fsid(dev_item);
-       write_extent_buffer(leaf, fs_info->metadata_uuid, ptr, BTRFS_UUID_SIZE);
+       write_extent_buffer(leaf, fs_info->fs_devices->metadata_uuid, ptr,
+                           BTRFS_UUID_SIZE);
        btrfs_mark_buffer_dirty(leaf);
        ret = 0;
 
@@ -2041,7 +2042,7 @@ static int read_one_dev(struct btrfs_fs_info *fs_info,
                           (unsigned long)btrfs_device_fsid(dev_item),
                           BTRFS_FSID_SIZE);
 
-       if (memcmp(fs_uuid, fs_info->fsid, BTRFS_UUID_SIZE)) {
+       if (memcmp(fs_uuid, fs_info->fs_devices->fsid, BTRFS_UUID_SIZE)) {
                ret = open_seed_devices(fs_info, fs_uuid);
                if (ret)
                        return ret;
-- 
2.17.1

++++++ 0004-btrfs-progs-Remove-btrfs_fs_info-new_fsid.patch ++++++
>From 1a438fc67c6b389221f20e25c13acd195fa0656b Mon Sep 17 00:00:00 2001
From: Nikolay Borisov <nbori...@suse.com>
Date: Thu, 11 Oct 2018 18:04:03 +0300
Subject: [PATCH 4/6] btrfs-progs: Remove btrfs_fs_info::new_fsid

This member was used only by btrfstune when using the old method to
change fsid. It's only an in-memory value with a very specific
purpose so it makes no sense to pollute a generic structure such as
btrfs_fs_info with it. Just remove it and pass it as a function
argument where pertinent. No functional changes.

Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
---
 btrfstune.c | 46 +++++++++++++++++++++-------------------------
 ctree.h     |  1 -
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/btrfstune.c b/btrfstune.c
index 500308b556fe..74a7c37195b0 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -201,15 +201,15 @@ static int set_super_incompat_flags(struct btrfs_root 
*root, u64 flags)
        return ret;
 }
 
-static int change_buffer_header_uuid(struct extent_buffer *eb)
+static int change_buffer_header_uuid(struct extent_buffer *eb, uuid_t new_fsid)
 {
        struct btrfs_fs_info *fs_info = eb->fs_info;
        int same_fsid = 1;
        int same_chunk_tree_uuid = 1;
        int ret;
 
-       same_fsid = !memcmp_extent_buffer(eb, fs_info->new_fsid,
-                       btrfs_header_fsid(), BTRFS_FSID_SIZE);
+       same_fsid = !memcmp_extent_buffer(eb, new_fsid, btrfs_header_fsid(),
+                                         BTRFS_FSID_SIZE);
        same_chunk_tree_uuid =
                !memcmp_extent_buffer(eb, fs_info->new_chunk_tree_uuid,
                                btrfs_header_chunk_tree_uuid(eb),
@@ -217,7 +217,7 @@ static int change_buffer_header_uuid(struct extent_buffer 
*eb)
        if (same_fsid && same_chunk_tree_uuid)
                return 0;
        if (!same_fsid)
-               write_extent_buffer(eb, fs_info->new_fsid, btrfs_header_fsid(),
+               write_extent_buffer(eb, new_fsid, btrfs_header_fsid(),
                                    BTRFS_FSID_SIZE);
        if (!same_chunk_tree_uuid)
                write_extent_buffer(eb, fs_info->new_chunk_tree_uuid,
@@ -228,7 +228,7 @@ static int change_buffer_header_uuid(struct extent_buffer 
*eb)
        return ret;
 }
 
-static int change_extents_uuid(struct btrfs_fs_info *fs_info)
+static int change_extents_uuid(struct btrfs_fs_info *fs_info, uuid_t new_fsid)
 {
        struct btrfs_root *root = fs_info->extent_root;
        struct btrfs_path path;
@@ -267,7 +267,7 @@ static int change_extents_uuid(struct btrfs_fs_info 
*fs_info)
                        ret = PTR_ERR(eb);
                        goto out;
                }
-               ret = change_buffer_header_uuid(eb);
+               ret = change_buffer_header_uuid(eb, new_fsid);
                free_extent_buffer(eb);
                if (ret < 0) {
                        error("failed to change uuid of tree block: %llu",
@@ -289,27 +289,27 @@ static int change_extents_uuid(struct btrfs_fs_info 
*fs_info)
        return ret;
 }
 
-static int change_device_uuid(struct extent_buffer *eb, int slot)
+static int change_device_uuid(struct extent_buffer *eb, int slot,
+                             uuid_t new_fsid)
 {
        struct btrfs_dev_item *di;
        struct btrfs_fs_info *fs_info = eb->fs_info;
        int ret = 0;
 
        di = btrfs_item_ptr(eb, slot, struct btrfs_dev_item);
-       if (!memcmp_extent_buffer(eb, fs_info->new_fsid,
+       if (!memcmp_extent_buffer(eb, new_fsid,
                                  (unsigned long)btrfs_device_fsid(di),
                                  BTRFS_FSID_SIZE))
                return ret;
 
-       write_extent_buffer(eb, fs_info->new_fsid,
-                           (unsigned long)btrfs_device_fsid(di),
+       write_extent_buffer(eb, new_fsid, (unsigned long)btrfs_device_fsid(di),
                            BTRFS_FSID_SIZE);
        ret = write_tree_block(NULL, fs_info, eb);
 
        return ret;
 }
 
-static int change_devices_uuid(struct btrfs_fs_info *fs_info)
+static int change_devices_uuid(struct btrfs_fs_info *fs_info, uuid_t new_fsid)
 {
        struct btrfs_root *root = fs_info->chunk_root;
        struct btrfs_path path;
@@ -327,7 +327,8 @@ static int change_devices_uuid(struct btrfs_fs_info 
*fs_info)
                if (key.type != BTRFS_DEV_ITEM_KEY ||
                    key.objectid != BTRFS_DEV_ITEMS_OBJECTID)
                        goto next;
-               ret = change_device_uuid(path.nodes[0], path.slots[0]);
+               ret = change_device_uuid(path.nodes[0], path.slots[0],
+                                        new_fsid);
                if (ret < 0)
                        goto out;
 next:
@@ -344,7 +345,7 @@ static int change_devices_uuid(struct btrfs_fs_info 
*fs_info)
        return ret;
 }
 
-static int change_fsid_prepare(struct btrfs_fs_info *fs_info)
+static int change_fsid_prepare(struct btrfs_fs_info *fs_info, uuid_t new_fsid)
 {
        struct btrfs_root *tree_root = fs_info->tree_root;
        u64 flags = btrfs_super_flags(fs_info->super_copy);
@@ -353,14 +354,13 @@ static int change_fsid_prepare(struct btrfs_fs_info 
*fs_info)
        flags |= BTRFS_SUPER_FLAG_CHANGING_FSID;
        btrfs_set_super_flags(fs_info->super_copy, flags);
 
-       memcpy(fs_info->super_copy->fsid, fs_info->new_fsid, BTRFS_FSID_SIZE);
+       memcpy(fs_info->super_copy->fsid, new_fsid, BTRFS_FSID_SIZE);
        ret = write_all_supers(fs_info);
        if (ret < 0)
                return ret;
 
        /* Also need to change the metadatauuid of the fs info */
-       memcpy(fs_info->fs_devices->metadata_uuid, fs_info->new_fsid,
-              BTRFS_FSID_SIZE);
+       memcpy(fs_info->fs_devices->metadata_uuid, new_fsid, BTRFS_FSID_SIZE);
 
        /* also restore new chunk_tree_id into tree_root for restore */
        write_extent_buffer(tree_root->node, fs_info->new_chunk_tree_uuid,
@@ -414,7 +414,6 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const 
char *new_fsid_str)
 
                uuid_generate(new_chunk_id);
        }
-       fs_info->new_fsid = new_fsid;
        fs_info->new_chunk_tree_uuid = new_chunk_id;
 
        memcpy(old_fsid, (const char*)fs_info->fs_devices->fsid, 
BTRFS_UUID_SIZE);
@@ -425,13 +424,13 @@ static int change_uuid(struct btrfs_fs_info *fs_info, 
const char *new_fsid_str)
        printf("New fsid: %s\n", uuid_buf);
        /* Now we can begin fsid change */
        printf("Set superblock flag CHANGING_FSID\n");
-       ret = change_fsid_prepare(fs_info);
+       ret = change_fsid_prepare(fs_info, new_fsid);
        if (ret < 0)
                goto out;
 
        /* Change extents first */
        printf("Change fsid in extents\n");
-       ret = change_extents_uuid(fs_info);
+       ret = change_extents_uuid(fs_info, new_fsid);
        if (ret < 0) {
                error("failed to change UUID of metadata: %d", ret);
                goto out;
@@ -439,17 +438,15 @@ static int change_uuid(struct btrfs_fs_info *fs_info, 
const char *new_fsid_str)
 
        /* Then devices */
        printf("Change fsid on devices\n");
-       ret = change_devices_uuid(fs_info);
+       ret = change_devices_uuid(fs_info, new_fsid);
        if (ret < 0) {
                error("failed to change UUID of devices: %d", ret);
                goto out;
        }
 
        /* Last, change fsid in super */
-       memcpy(fs_info->fs_devices->fsid, fs_info->new_fsid,
-              BTRFS_FSID_SIZE);
-       memcpy(fs_info->super_copy->fsid, fs_info->new_fsid,
-              BTRFS_FSID_SIZE);
+       memcpy(fs_info->fs_devices->fsid, new_fsid, BTRFS_FSID_SIZE);
+       memcpy(fs_info->super_copy->fsid, new_fsid, BTRFS_FSID_SIZE);
        ret = write_all_supers(fs_info);
        if (ret < 0)
                goto out;
@@ -457,7 +454,6 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const 
char *new_fsid_str)
        /* Now fsid change is done */
        printf("Clear superblock flag CHANGING_FSID\n");
        ret = change_fsid_done(fs_info);
-       fs_info->new_fsid = NULL;
        fs_info->new_chunk_tree_uuid = NULL;
        printf("Fsid change finished\n");
 out:
diff --git a/ctree.h b/ctree.h
index dec0dab1dde5..2abdea676b92 100644
--- a/ctree.h
+++ b/ctree.h
@@ -1093,7 +1093,6 @@ struct btrfs_block_group_cache {
 struct btrfs_device;
 struct btrfs_fs_devices;
 struct btrfs_fs_info {
-       u8 *new_fsid;
        u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
        u8 *new_chunk_tree_uuid;
        struct btrfs_root *fs_root;
-- 
2.17.1

++++++ 0005-btrfs-progs-Directly-pass-root-to-change_devices_uui.patch ++++++
>From eb9657f801e4565acb8ba6b59f69e34316104c52 Mon Sep 17 00:00:00 2001
From: Nikolay Borisov <nbori...@suse.com>
Date: Thu, 11 Oct 2018 18:04:04 +0300
Subject: [PATCH 5/6] btrfs-progs: Directly pass root to change_devices_uuid

This function currently takes an fs_info only to reference the chunk
root. Just pass the root directly. No functional changes.

Signed-off-by: Nikolay Borisov <nbori...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
---
 btrfstune.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/btrfstune.c b/btrfstune.c
index 74a7c37195b0..7466f7f4a198 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -309,9 +309,8 @@ static int change_device_uuid(struct extent_buffer *eb, int 
slot,
        return ret;
 }
 
-static int change_devices_uuid(struct btrfs_fs_info *fs_info, uuid_t new_fsid)
+static int change_devices_uuid(struct btrfs_root *root, uuid_t new_fsid)
 {
-       struct btrfs_root *root = fs_info->chunk_root;
        struct btrfs_path path;
        struct btrfs_key key = {0, 0, 0};
        int ret = 0;
@@ -438,7 +437,7 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const 
char *new_fsid_str)
 
        /* Then devices */
        printf("Change fsid on devices\n");
-       ret = change_devices_uuid(fs_info, new_fsid);
+       ret = change_devices_uuid(fs_info->chunk_root, new_fsid);
        if (ret < 0) {
                error("failed to change UUID of devices: %d", ret);
                goto out;
-- 
2.17.1

++++++ boot-btrfs.sh ++++++
#!/bin/bash -e
#%stage: filesystem
#%depends: dm dmraid lvm2 udev md luks
#%programs: btrfs
#%programs: btrfs-convert
#%programs: btrfs-find-root
#%programs: btrfs-image
#%programs: btrfs-select-super
#%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-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch
 ++++++
From: Jeff Mahoney <je...@suse.com>
Subject: btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny
 metadata
Git-commit: 50faf73f22d12269614ecf55fc5ee48ab7d1cf3b
Patch-mainline: v5.1
References: bsc#1131334

When repairing a file system created by a very old kernel, I ran into
issues fixing up the extent flags since fixup_extent_flags assumed
that a METADATA_ITEM would be present if the record was for metadata.

Since METADATA_ITEMs don't exist without skinny metadata, we need to
fall back to EXTENT_ITEMs.  This also falls back to EXTENT_ITEMs even
with skinny metadata enabled as other parts of the tools do.

Reviewed-by: Filipe Manana <fdman...@suse.com>
Signed-off-by: Jeff Mahoney <je...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
---
 check/main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/check/main.c b/check/main.c
index 683c322e..e6b866f8 100644
--- a/check/main.c
+++ b/check/main.c
@@ -7634,9 +7634,13 @@ static int fixup_extent_flags(struct btrfs_fs_info 
*fs_info,
        struct btrfs_key key;
        u64 flags;
        int ret = 0;
+       bool metadata_item = rec->metadata;
 
+       if (!btrfs_fs_incompat(root->fs_info, SKINNY_METADATA))
+               metadata_item = false;
+retry:
        key.objectid = rec->start;
-       if (rec->metadata) {
+       if (metadata_item) {
                key.type = BTRFS_METADATA_ITEM_KEY;
                key.offset = rec->info_level;
        } else {
@@ -7655,6 +7659,10 @@ static int fixup_extent_flags(struct btrfs_fs_info 
*fs_info,
                btrfs_commit_transaction(trans, root);
                return ret;
        } else if (ret) {
+               if (key.type == BTRFS_METADATA_ITEM_KEY) {
+                       metadata_item = false;
+                       goto retry;
+               }
                fprintf(stderr, "Didn't find extent for %llu\n",
                        (unsigned long long)rec->start);
                btrfs_release_path(&path);

++++++ btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch ++++++
>From b9b5d2c6ef280f15517350c7bbd85963b1cdd2a9 Mon Sep 17 00:00:00 2001
From: Naohiro Aota <naohiro.a...@wdc.com>
Date: Tue, 23 Jul 2019 18:19:11 +0900
Subject: [PATCH] btrfs-progs: check: initialize qgroup_item_count in earlier 
stage
Git-commit: 8ca6c0c3c718
Patch-mainline: v5.2.1
References: bsc#1158560

"btrfsck -Q" segfaults because it does not call qgroup_set_item_count_ptr()
Properly: 

  # btrfsck -Q /dev/sdk
  Opening filesystem to check...
  Checking filesystem on /dev/sdk
  UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3
  Print quota groups for /dev/sdk
  UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3
  Segmentation fault (core dumped)

Since "struct task_ctx ctx" is global, we can just move
qgroup_set_item_count_ptr() much earlier stage in the check process to
avoid to forget initializing it.

Signed-off-by: Naohiro Aota <naohiro.a...@wdc.com>
Reviewed-by: Qu Wenruo <w...@suse.com>
Signed-off-by: David Sterba <dste...@suse.com>
Acked-by: Libor Pechacek <lpecha...@suse.com>

---
 check/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: btrfs-progs-v4.19.1/check/main.c
===================================================================
--- btrfs-progs-v4.19.1.orig/check/main.c
+++ btrfs-progs-v4.19.1/check/main.c
@@ -9688,6 +9688,7 @@ int cmd_check(int argc, char **argv)
 
        radix_tree_init();
        cache_tree_init(&root_cache);
+       qgroup_set_item_count_ptr(&ctx.item_count);
 
        ret = check_mounted(argv[optind]);
        if (!force) {
@@ -10014,7 +10015,6 @@ int cmd_check(int argc, char **argv)
        }
 
        if (info->quota_enabled) {
-               qgroup_set_item_count_ptr(&ctx.item_count);
                if (!ctx.progress_enabled) {
                        fprintf(stderr, "[7/7] checking quota groups\n");
                } else {
++++++ dracut-fsck-help.txt ++++++
Recovery of btrfs file systems is not automated. We suggest you use
'btrfs check --readonly' first to see the if there's any damage and
what's the scope. Logging the output is a recommended for later analysis.

The option '--repair' must be used with care, be noted that it is
able to fix certain classes of errors but not all of them.
++++++ mkfs-default-features.patch ++++++
From: Jeff Mahoney <je...@suse.com>
Subject: mkfs: allow site to override defaults
Patch-mainline: Never, a real solution with a config file is required
References: FATE#320615

This is a simple method to allow us to set site defaults for mkfs by
adding -include <includefile> to cflags.

Signed-off-by: Jeff Mahoney <je...@suse.com>
---
 utils.h |    4 ++++
 1 file changed, 4 insertions(+)

Index: btrfs-progs-v4.10.2/fsfeatures.h
===================================================================
--- btrfs-progs-v4.10.2.orig/fsfeatures.h
+++ btrfs-progs-v4.10.2/fsfeatures.h
@@ -19,10 +19,14 @@
 
 #include "kerncompat.h"
 
+#ifndef BTRFS_MKFS_DEFAULT_NODE_SIZE
 #define BTRFS_MKFS_DEFAULT_NODE_SIZE SZ_16K
+#endif
+#ifndef BTRFS_MKFS_DEFAULT_FEATURES
 #define BTRFS_MKFS_DEFAULT_FEATURES                            \
                (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF           \
                | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)
+#endif
 
 /*
  * Avoid multi-device features (RAID56) and mixed block groups
++++++ module-setup.sh.in ++++++
#!/bin/bash

# called by dracut
check() {
    return 0
}

# called by dracut
depends() {
    return 0
}

# called by dracut
install() {
    inst_fsck_help "btrfs" "@@INSTALLDIR@@/dracut-fsck-help.txt"
}

++++++ 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
++++++ sles11-defaults.h ++++++
#ifndef _SLES11_DEFAULTS_H
#define _SLES11_DEFAULTS_H
#define BTRFS_MKFS_DEFAULT_NODE_SIZE sysconf(_SC_PAGESIZE)
#define BTRFS_MKFS_DEFAULT_FEATURES BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF
#endif

Reply via email to