From b69a47601da7c9cb4ad4fbd5e2d85f04e69791d0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 27 Nov 2013 18:27:33 -0200 Subject: linux-libre-3.12.1-3: updating revision with some fixes * update 3.12.1 version for mips64el * fix btrfs balance bug * readd CHECKPOINT_RESTORE --- libre/linux-libre/3.12-btrfs-relocate-csums.patch | 63 +++++++++++++++++++++++ libre/linux-libre/PKGBUILD | 19 ++++--- libre/linux-libre/config.x86_64 | 5 +- 3 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 libre/linux-libre/3.12-btrfs-relocate-csums.patch (limited to 'libre/linux-libre') diff --git a/libre/linux-libre/3.12-btrfs-relocate-csums.patch b/libre/linux-libre/3.12-btrfs-relocate-csums.patch new file mode 100644 index 000000000..7209276ef --- /dev/null +++ b/libre/linux-libre/3.12-btrfs-relocate-csums.patch @@ -0,0 +1,63 @@ +From 4577b014d1bc3db386da3246f625888fc48083a9 Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Fri, 27 Sep 2013 13:33:09 +0000 +Subject: Btrfs: relocate csums properly with prealloc extents + +A user reported a problem where they were getting csum errors when running a +balance and running systemd's journal. This is because systemd is awesome and +fallocate()'s its log space and writes into it. Unfortunately we assume that +when we read in all the csums for an extent that they are sequential starting at +the bytenr we care about. This obviously isn't the case for prealloc extents, +where we could have written to the middle of the prealloc extent only, which +means the csum would be for the bytenr in the middle of our range and not the +front of our range. Fix this by offsetting the new bytenr we are logging to +based on the original bytenr the csum was for. With this patch I no longer see +the csum errors I was seeing. Thanks, + +Cc: stable@vger.kernel.org +Reported-by: Chris Murphy +Signed-off-by: Josef Bacik +Signed-off-by: Chris Mason +--- +diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c +index dec4f5a..0359eec 100644 +--- a/fs/btrfs/relocation.c ++++ b/fs/btrfs/relocation.c +@@ -4472,6 +4472,7 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len) + struct btrfs_root *root = BTRFS_I(inode)->root; + int ret; + u64 disk_bytenr; ++ u64 new_bytenr; + LIST_HEAD(list); + + ordered = btrfs_lookup_ordered_extent(inode, file_pos); +@@ -4483,13 +4484,24 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len) + if (ret) + goto out; + +- disk_bytenr = ordered->start; + while (!list_empty(&list)) { + sums = list_entry(list.next, struct btrfs_ordered_sum, list); + list_del_init(&sums->list); + +- sums->bytenr = disk_bytenr; +- disk_bytenr += sums->len; ++ /* ++ * We need to offset the new_bytenr based on where the csum is. ++ * We need to do this because we will read in entire prealloc ++ * extents but we may have written to say the middle of the ++ * prealloc extent, so we need to make sure the csum goes with ++ * the right disk offset. ++ * ++ * We can do this because the data reloc inode refers strictly ++ * to the on disk bytes, so we don't have to worry about ++ * disk_len vs real len like with real inodes since it's all ++ * disk length. ++ */ ++ new_bytenr = ordered->start + (sums->bytenr - disk_bytenr); ++ sums->bytenr = new_bytenr; + + btrfs_add_ordered_sum(inode, ordered, sums); + } +-- +cgit v0.9.2 diff --git a/libre/linux-libre/PKGBUILD b/libre/linux-libre/PKGBUILD index 05aad9102..5dc34d0df 100644 --- a/libre/linux-libre/PKGBUILD +++ b/libre/linux-libre/PKGBUILD @@ -1,19 +1,19 @@ -# $Id: PKGBUILD 200014 2013-11-21 08:49:51Z tpowa $ +# $Id: PKGBUILD 200328 2013-11-26 10:43:40Z tpowa $ # Maintainer: Tobias Powalowski # Maintainer: Thomas Baechler # Maintainer (Parabola): André Silva # Contributor (Parabola): Nicolás Reynolds # Contributor (Parabola): Sorin-Mihai Vârgolici # Contributor (Parabola): Michał Masłowski -# Contributor (Parabola): Márcio Silva +# Contributor (Parabola): Márcio Silva pkgbase=linux-libre # Build stock -LIBRE kernel #pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.12 _sublevel=1 pkgver=${_basekernel}.${_sublevel} -pkgrel=1 -_lxopkgver=${_basekernel}.0 # nearly always the same as pkgver +pkgrel=3 +_lxopkgver=${_basekernel}.1 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -30,18 +30,20 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn 'boot-logo.patch' 'change-default-console-loglevel.patch' 'criu-no-expert.patch' + '3.12-btrfs-relocate-csums.patch' "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.bz2") md5sums=('254f59707b6676b59ce5ca5c3c698319' '0e52518b2bdf3aa7af0c63a4acfd7957' '7cadb85598587ca85b84005420836a01' - '8e9c701b77f0319d6f95046d6ab2f3e1' + 'b15bd4bf2bd8984f3c52b81f005f3c14' 'e49ac236dfeef709f91a3d993ea7b62c' '2967cecc3af9f954ccc822fd63dca6ff' '8267264d9a8966e57fdacd1fa1fc65c4' '44260d2cb1a8b51c119d2ce1f83e457a' '98beb36f9b8cf16e58de2483ea9985e3' 'd50c1ac47394e9aec637002ef3392bd1' - 'b866344d7dd8d8c8b06974e8a6494f9a') + '923c1728634d4e0f7b77177c36d94791' + '452c06684f07bfa9a478263e1c8649af') if [ "$CARCH" != "mips64el" ]; then # don't use the Loongson-specific patches on non-mips64el arches. unset source[${#source[@]}-1] @@ -73,6 +75,11 @@ prepare() { # patch from fedora patch -Np1 -i "${srcdir}/criu-no-expert.patch" + # fix btrfs balance bug + # https://bugzilla.kernel.org/show_bug.cgi?id=63411 + # https://bugs.archlinux.org/task/37867 + patch -Np1 -i "${srcdir}/3.12-btrfs-relocate-csums.patch" + if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre|" Makefile sed -r "s|^( SUBLEVEL = ).*|\1$_sublevel|" \ diff --git a/libre/linux-libre/config.x86_64 b/libre/linux-libre/config.x86_64 index d61c98261..71951e28d 100644 --- a/libre/linux-libre/config.x86_64 +++ b/libre/linux-libre/config.x86_64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 3.12.0-1 Kernel Configuration +# Linux/x86 3.12.1-3 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y @@ -167,7 +167,7 @@ CONFIG_CFS_BANDWIDTH=y CONFIG_RT_GROUP_SCHED=y CONFIG_BLK_CGROUP=y # CONFIG_DEBUG_BLK_CGROUP is not set -# CONFIG_CHECKPOINT_RESTORE is not set +CONFIG_CHECKPOINT_RESTORE=y CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y @@ -472,6 +472,7 @@ CONFIG_FRONTSWAP=y # CONFIG_CMA is not set CONFIG_ZBUD=y CONFIG_ZSWAP=y +CONFIG_MEM_SOFT_DIRTY=y CONFIG_X86_CHECK_BIOS_CORRUPTION=y CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y CONFIG_X86_RESERVE_LOW=64 -- cgit v1.2.3