From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57008 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbdJBMaJ (ORCPT ); Mon, 2 Oct 2017 08:30:09 -0400 Subject: Patch "btrfs: propagate error to btrfs_cmp_data_prepare caller" has been added to the 4.13-stable tree To: naohiro.aota@wdc.com, dsterba@suse.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 02 Oct 2017 14:30:05 +0200 Message-ID: <150694740528255@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: propagate error to btrfs_cmp_data_prepare caller to the 4.13-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-propagate-error-to-btrfs_cmp_data_prepare-caller.patch and it can be found in the queue-4.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 78ad4ce014d025f41b8dde3a81876832ead643cf Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 8 Sep 2017 17:48:55 +0900 Subject: btrfs: propagate error to btrfs_cmp_data_prepare caller From: Naohiro Aota commit 78ad4ce014d025f41b8dde3a81876832ead643cf upstream. btrfs_cmp_data_prepare() (almost) always returns 0 i.e. ignoring errors from gather_extent_pages(). While the pages are freed by btrfs_cmp_data_free(), cmp->num_pages still has > 0. Then, btrfs_extent_same() try to access the already freed pages causing faults (or violates PageLocked assertion). This patch just return the error as is so that the caller stop the process. Signed-off-by: Naohiro Aota Fixes: f441460202cb ("btrfs: fix deadlock with extent-same and readpage") Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3063,7 +3063,7 @@ static int btrfs_cmp_data_prepare(struct out: if (ret) btrfs_cmp_data_free(cmp); - return 0; + return ret; } static int btrfs_cmp_data(u64 len, struct cmp_pages *cmp) Patches currently in stable-queue which might be from naohiro.aota@wdc.com are queue-4.13/btrfs-propagate-error-to-btrfs_cmp_data_prepare-caller.patch queue-4.13/btrfs-fix-null-pointer-dereference-from-free_reloc_roots.patch queue-4.13/btrfs-clear-ordered-flag-on-cleaning-up-ordered-extents.patch queue-4.13/btrfs-finish-ordered-extent-cleaning-if-no-progress-is-found.patch