From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34222 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758909AbdLRMzh (ORCPT ); Mon, 18 Dec 2017 07:55:37 -0500 Subject: Patch "badblocks: fix wrong return value in badblocks_set if badblocks are disabled" has been added to the 4.14-stable tree To: bo.li.liu@oracle.com, alexander.levin@verizon.com, gqjiang@suse.com, gregkh@linuxfoundation.org, shli@fb.com Cc: , From: Date: Mon, 18 Dec 2017 13:55:28 +0100 Message-ID: <1513601728197247@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 badblocks: fix wrong return value in badblocks_set if badblocks are disabled to the 4.14-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: badblocks-fix-wrong-return-value-in-badblocks_set-if-badblocks-are-disabled.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Dec 18 13:28:59 CET 2017 From: Liu Bo Date: Fri, 3 Nov 2017 11:24:44 -0600 Subject: badblocks: fix wrong return value in badblocks_set if badblocks are disabled From: Liu Bo [ Upstream commit 39b4954c0a1556f8f7f1fdcf59a227117fcd8a0b ] MD's rdev_set_badblocks() expects that badblocks_set() returns 1 if badblocks are disabled, otherwise, rdev_set_badblocks() will record superblock changes and return success in that case and md will fail to report an IO error which it should. This bug has existed since badblocks were introduced in commit 9e0e252a048b ("badblocks: Add core badblock management code"). Signed-off-by: Liu Bo Acked-by: Guoqing Jiang Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- block/badblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/block/badblocks.c +++ b/block/badblocks.c @@ -178,7 +178,7 @@ int badblocks_set(struct badblocks *bb, if (bb->shift < 0) /* badblocks are disabled */ - return 0; + return 1; if (bb->shift) { /* round the start down, and the end up */ Patches currently in stable-queue which might be from bo.li.liu@oracle.com are queue-4.14/badblocks-fix-wrong-return-value-in-badblocks_set-if-badblocks-are-disabled.patch queue-4.14/btrfs-fix-false-eio-for-missing-device.patch