From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43756 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754172AbcFEWDR (ORCPT ); Sun, 5 Jun 2016 18:03:17 -0400 Subject: Patch "btrfs: make state preallocation more speculative in __set_extent_bit" has been added to the 4.5-stable tree To: dsterba@suse.com, gregkh@linuxfoundation.org Cc: , From: Date: Sun, 05 Jun 2016 14:48:37 -0700 Message-ID: <146516331751117@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled btrfs: make state preallocation more speculative in __set_extent_bit to the 4.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-make-state-preallocation-more-speculative-in-__set_extent_bit.patch and it can be found in the queue-4.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 059f791c6bbaba72dc3c1bd6e2657aacc8552849 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 27 Apr 2016 01:03:45 +0200 Subject: btrfs: make state preallocation more speculative in __set_extent_bit From: David Sterba commit 059f791c6bbaba72dc3c1bd6e2657aacc8552849 upstream. Similar to __clear_extent_bit, do not fail if the state preallocation fails as we might not need it. One less BUG_ON. Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/extent_io.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -875,8 +875,14 @@ __set_extent_bit(struct extent_io_tree * bits |= EXTENT_FIRST_DELALLOC; again: if (!prealloc && gfpflags_allow_blocking(mask)) { + /* + * Don't care for allocation failure here because we might end + * up not needing the pre-allocated extent state at all, which + * is the case if we only have in the tree extent states that + * cover our input range and don't cover too any other range. + * If we end up needing a new extent state we allocate it later. + */ prealloc = alloc_extent_state(mask); - BUG_ON(!prealloc); } spin_lock(&tree->lock); Patches currently in stable-queue which might be from dsterba@suse.com are queue-4.5/btrfs-bugfix-handle-fs_ioc32_-getflags-setflags-getversion-in-btrfs_ioctl.patch queue-4.5/btrfs-pass-the-right-error-code-to-the-btrfs_std_error.patch queue-4.5/btrfs-fix-mixed-block-count-of-available-space.patch queue-4.5/btrfs-fix-memory-leak-during-raid-5-6-device-replacement.patch queue-4.5/btrfs-fix-unexpected-return-value-of-fiemap.patch queue-4.5/btrfs-do-not-create-empty-block-group-if-we-have-allocated-data.patch queue-4.5/btrfs-add-check-to-sysfs-handler-of-label.patch queue-4.5/btrfs-avoid-overflowing-f_bfree.patch queue-4.5/btrfs-fix-int32-overflow-in-shrink_delalloc.patch queue-4.5/btrfs-remove-bug_on-s-in-btrfs_map_block.patch queue-4.5/btrfs-make-state-preallocation-more-speculative-in-__set_extent_bit.patch queue-4.5/btrfs-fix-fspath-error-deallocation.patch queue-4.5/btrfs-scrub-set-bbio-to-null-before-calling-btrfs_map_block.patch queue-4.5/btrfs-add-write-protection-to-set_features-ioctl.patch queue-4.5/btrfs-allow-balancing-to-dup-with-multi-device.patch queue-4.5/btrfs-fix-divide-error-upon-chunk-s-stripe_len.patch queue-4.5/btrfs-fix-lock-dep-warning-move-scratch-dev-out-of-device_list_mutex-and-uuid_mutex.patch