diff --git a/0001-btrfs-progs-mkfs-use-correct-size-for-superblock-csu.patch b/0001-btrfs-progs-mkfs-use-correct-size-for-superblock-csu.patch new file mode 100644 index 0000000..47d0ebb --- /dev/null +++ b/0001-btrfs-progs-mkfs-use-correct-size-for-superblock-csu.patch @@ -0,0 +1,41 @@ +From bf1ac8305ab3f191d9345793b88c4f5ec691cb9b Mon Sep 17 00:00:00 2001 +From: David Sterba +Date: Thu, 19 Nov 2015 15:55:05 +0100 +Subject: [PATCH] btrfs-progs: mkfs: use correct size for superblock csum and + writeout + +If sectorsize is not BTRFS_SUPER_INFO_SIZE (4k), the superblock checksum +is wrong and mkfs fails. This has been reported on ppc64 where we pick +sectorisize from page size (64k). This has been broken since ages +(2008) and discovered by the recently added superblock checks. + +Reported-by: Dinar Valeev +Signed-off-by: David Sterba +--- + utils.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/utils.c b/utils.c +index 60235d84889c..13835051a1a5 100644 +--- a/utils.c ++++ b/utils.c +@@ -552,12 +552,12 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg) + + /* and write out the super block */ + BUG_ON(sizeof(super) > cfg->sectorsize); +- memset(buf->data, 0, cfg->sectorsize); ++ memset(buf->data, 0, BTRFS_SUPER_INFO_SIZE); + memcpy(buf->data, &super, sizeof(super)); +- buf->len = cfg->sectorsize; ++ buf->len = BTRFS_SUPER_INFO_SIZE; + csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0); +- ret = pwrite(fd, buf->data, cfg->sectorsize, cfg->blocks[0]); +- if (ret != cfg->sectorsize) { ++ ret = pwrite(fd, buf->data, BTRFS_SUPER_INFO_SIZE, cfg->blocks[0]); ++ if (ret != BTRFS_SUPER_INFO_SIZE) { + ret = (ret < 0 ? -errno : -EIO); + goto out; + } +-- +2.6.2 + diff --git a/btrfsprogs.changes b/btrfsprogs.changes index fbdec44..60d1fe5 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 24 00:00:00 CET 2015 - dsterba@suse.cz + +- fix mkfs failure on ppc64 (or with sectorsize > 4k) (bsc#956819) +- Added patch: 0001-btrfs-progs-mkfs-use-correct-size-for-superblock-csu.patch + ------------------------------------------------------------------- Mon Nov 16 00:00:00 CET 2015 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 4a6ce69..60f51a7 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -37,6 +37,8 @@ Source: https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs Source1: boot-btrfs.sh Source4: setup-btrfs.sh +Patch1: 0001-btrfs-progs-mkfs-use-correct-size-for-superblock-csu.patch + Patch163: 0163-btrfs-progs-fsck-fix-segfault.patch Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch @@ -106,6 +108,7 @@ build applications to interface with btrfs. %prep %setup -q -n btrfs-progs-v%{version} +%patch1 -p1 %patch163 -p1 %patch167 -p1 %patch168 -p1 diff --git a/local-version-override.patch b/local-version-override.patch index 4aff11b..f9f4128 100644 --- a/local-version-override.patch +++ b/local-version-override.patch @@ -7,7 +7,7 @@ Index: btrfs-progs-v4.1/version.sh # Released under the GNU GPLv2 -v="v4.3.1" -+v="v4.3+20151116" ++v="v4.3.1+20151124" opt=$1