From: Greg Kroah-Hartman Date: Tue, 17 May 2016 00:01:03 +0000 (-0700) Subject: 4.5-stable patches X-Git-Tag: v3.14.70~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb1baefe6dd193533fb70da8358d552c3b89d907;p=thirdparty%2Fkernel%2Fstable-queue.git 4.5-stable patches added patches: btrfs-fix-truncate_space_check.patch btrfs-reada-fix-in-segment-calculation-for-reada.patch btrfs-remove-error-message-from-search-ioctl-for-nonexistent-tree.patch --- diff --git a/queue-4.5/btrfs-fix-truncate_space_check.patch b/queue-4.5/btrfs-fix-truncate_space_check.patch new file mode 100644 index 00000000000..c945a981e89 --- /dev/null +++ b/queue-4.5/btrfs-fix-truncate_space_check.patch @@ -0,0 +1,46 @@ +From dc95f7bfc57fa4b75a77d0da84d5db249d74aa3f Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Wed, 13 Jan 2016 11:48:06 -0500 +Subject: Btrfs: fix truncate_space_check + +From: Josef Bacik + +commit dc95f7bfc57fa4b75a77d0da84d5db249d74aa3f upstream. + +truncate_space_check is using btrfs_csum_bytes_to_leaves() but forgetting to +multiply by nodesize so we get an actual byte count. We need a tracepoint here +so that we have the matching reserve for the release that will come later. Also +add a comment to make clear what the intent of truncate_space_check is. + +Signed-off-by: Josef Bacik +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/inode.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -4211,11 +4211,20 @@ static int truncate_space_check(struct b + { + int ret; + ++ /* ++ * This is only used to apply pressure to the enospc system, we don't ++ * intend to use this reservation at all. ++ */ + bytes_deleted = btrfs_csum_bytes_to_leaves(root, bytes_deleted); ++ bytes_deleted *= root->nodesize; + ret = btrfs_block_rsv_add(root, &root->fs_info->trans_block_rsv, + bytes_deleted, BTRFS_RESERVE_NO_FLUSH); +- if (!ret) ++ if (!ret) { ++ trace_btrfs_space_reservation(root->fs_info, "transaction", ++ trans->transid, ++ bytes_deleted, 1); + trans->bytes_reserved += bytes_deleted; ++ } + return ret; + + } diff --git a/queue-4.5/btrfs-reada-fix-in-segment-calculation-for-reada.patch b/queue-4.5/btrfs-reada-fix-in-segment-calculation-for-reada.patch new file mode 100644 index 00000000000..85c8c6bdc83 --- /dev/null +++ b/queue-4.5/btrfs-reada-fix-in-segment-calculation-for-reada.patch @@ -0,0 +1,47 @@ +From 503785306d182ab624a2232856ef8ab503ee85f9 Mon Sep 17 00:00:00 2001 +From: Zhao Lei +Date: Fri, 18 Dec 2015 21:33:05 +0800 +Subject: btrfs: reada: Fix in-segment calculation for reada + +From: Zhao Lei + +commit 503785306d182ab624a2232856ef8ab503ee85f9 upstream. + +reada_zone->end is end pos of segment: + end = start + cache->key.offset - 1; + +So we need to use "<=" in condition to judge is a pos in the +segment. + +The problem happened rearly, because logical pos rarely pointed +to last 4k of a blockgroup, but we need to fix it to make code +right in logic. + +Signed-off-by: Zhao Lei +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/reada.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/btrfs/reada.c ++++ b/fs/btrfs/reada.c +@@ -265,7 +265,7 @@ static struct reada_zone *reada_find_zon + spin_unlock(&fs_info->reada_lock); + + if (ret == 1) { +- if (logical >= zone->start && logical < zone->end) ++ if (logical >= zone->start && logical <= zone->end) + return zone; + spin_lock(&fs_info->reada_lock); + kref_put(&zone->refcnt, reada_zone_release); +@@ -679,7 +679,7 @@ static int reada_start_machine_dev(struc + */ + ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, + dev->reada_next >> PAGE_CACHE_SHIFT, 1); +- if (ret == 0 || re->logical >= dev->reada_curr_zone->end) { ++ if (ret == 0 || re->logical > dev->reada_curr_zone->end) { + ret = reada_pick_zone(dev); + if (!ret) { + spin_unlock(&fs_info->reada_lock); diff --git a/queue-4.5/btrfs-remove-error-message-from-search-ioctl-for-nonexistent-tree.patch b/queue-4.5/btrfs-remove-error-message-from-search-ioctl-for-nonexistent-tree.patch new file mode 100644 index 00000000000..af9421206cf --- /dev/null +++ b/queue-4.5/btrfs-remove-error-message-from-search-ioctl-for-nonexistent-tree.patch @@ -0,0 +1,33 @@ +From 11ea474f74709fc764fb7e80306e0776f94ce8b8 Mon Sep 17 00:00:00 2001 +From: David Sterba +Date: Thu, 11 Feb 2016 15:30:07 +0100 +Subject: btrfs: remove error message from search ioctl for nonexistent tree + +From: David Sterba + +commit 11ea474f74709fc764fb7e80306e0776f94ce8b8 upstream. + +Let's remove the error message that appears when the tree_id is not +present. This can happen with the quota tree and has been observed in +practice. The applications are supposed to handle -ENOENT and we don't +need to report that in the system log as it's not a fatal error. + +Reported-by: Vlastimil Babka +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/ioctl.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/fs/btrfs/ioctl.c ++++ b/fs/btrfs/ioctl.c +@@ -2097,8 +2097,6 @@ static noinline int search_ioctl(struct + key.offset = (u64)-1; + root = btrfs_read_fs_root_no_name(info, &key); + if (IS_ERR(root)) { +- btrfs_err(info, "could not find root %llu", +- sk->tree_id); + btrfs_free_path(path); + return -ENOENT; + } diff --git a/queue-4.5/series b/queue-4.5/series index 54eebb714b9..5299d3a9877 100644 --- a/queue-4.5/series +++ b/queue-4.5/series @@ -81,3 +81,6 @@ drm-i915-bdw-add-missing-delay-during-l3-sqc-credit-programming.patch drm-radeon-fix-dp-link-training-issue-with-second-4k-monitor.patch drm-radeon-fix-dp-mode-validation.patch drm-amdgpu-fix-dp-mode-validation.patch +btrfs-reada-fix-in-segment-calculation-for-reada.patch +btrfs-fix-truncate_space_check.patch +btrfs-remove-error-message-from-search-ioctl-for-nonexistent-tree.patch