From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A794BC433DF for ; Thu, 18 Jun 2020 14:47:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81ABB20888 for ; Thu, 18 Jun 2020 14:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592491676; bh=EvW+SGiPYv6QhSeUNwfbFUqdj0SNMuDZIPWuj78O+rU=; h=Subject:To:Cc:From:Date:List-ID:From; b=fStvcNEPArQNBm8puJQjZNdDCAohi2Wp5Xg38fkNMowp+mDIN4s8CHasRyOR0kzUc hd5i6DuTPPXfxmB7PZMHfBRcpM/+6UJXusFukBzVPqazrYFYRnZetmQ/9Z0xuWYwZK gF3hVQvsZuQgLxJyKu7Os2mUkBx61iS1Tsu3rZ/E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgFROrw (ORCPT ); Thu, 18 Jun 2020 10:47:52 -0400 Received: from wforward2-smtp.messagingengine.com ([64.147.123.31]:36957 "EHLO wforward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730950AbgFROrn (ORCPT ); Thu, 18 Jun 2020 10:47:43 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 4870D69B; Thu, 18 Jun 2020 10:47:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 18 Jun 2020 10:47:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Z9vgg1 S6DA+hJGL8fQylCTUxu4/q9Kns/G1itQdJQ/U=; b=N9Q41zriFurVIWQh3zx1m8 aWDtJgDLnDFSh2YmZ9ZAFTIdZVGGowElYmidDtCUQmvSEiJSf1YNV/DMXjZKyHJO Y3iPQzOiooTDB6DNijvMmV9Uv/bIEUgfOyL5rIoQSgo8E/yzmaIg+l2Ql+ElHE/g 9kilVBK80F7XQAuys2YjFvZ9UWT7dQ9XCOwGsCCZi1vdIO/3FFrDjzsUHJz0rxQS R7IFzwmiPtU3LCqfykD63ExgQt+Uvw61/i4qrtbX9fGREK4+Yq2N3zNPWfNEPoWW l+XMOKswRpa1FpEOYpv1w3NWDblJdG4ZRR/TZbkwSPATBPfzmyYq/flGOiWzQh2g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuggftrfgrthhtvghrnhepieetveehuedvhfdtgfdvieeiheehfeelveevheejud etveeuveeludejjefgteehnecukfhppeekfedrkeeirdekledruddtjeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhh drtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 70B6D3062499; Thu, 18 Jun 2020 10:47:41 -0400 (EDT) Subject: FAILED: patch "[PATCH] btrfs: fix wrong file range cleanup after an error filling" failed to apply to 4.14-stable tree To: fdmanana@suse.com, dsterba@suse.com Cc: From: Date: Thu, 18 Jun 2020 16:47:35 +0200 Message-ID: <159249165512742@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 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e2c8e92d1140754073ad3799eb6620c76bab2078 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Wed, 27 May 2020 11:15:53 +0100 Subject: [PATCH] btrfs: fix wrong file range cleanup after an error filling dealloc range If an error happens while running dellaloc in COW mode for a range, we can end up calling extent_clear_unlock_delalloc() for a range that goes beyond our range's end offset by 1 byte, which affects 1 extra page. This results in clearing bits and doing page operations (such as a page unlock) outside our target range. Fix that by calling extent_clear_unlock_delalloc() with an inclusive end offset, instead of an exclusive end offset, at cow_file_range(). Fixes: a315e68f6e8b30 ("Btrfs: fix invalid attempt to free reserved space on failure to cow range") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4583f0763571..1b6cd937f214 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1141,7 +1141,7 @@ static noinline int cow_file_range(struct inode *inode, */ if (extent_reserved) { extent_clear_unlock_delalloc(inode, start, - start + cur_alloc_size, + start + cur_alloc_size - 1, locked_page, clear_bits, page_ops);