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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DCDAC6FD1A for ; Tue, 7 Mar 2023 18:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233366AbjCGSwV (ORCPT ); Tue, 7 Mar 2023 13:52:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbjCGSwF (ORCPT ); Tue, 7 Mar 2023 13:52:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C84BABB04 for ; Tue, 7 Mar 2023 10:40:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 51187B819CD for ; Tue, 7 Mar 2023 18:39:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 976D6C433D2; Tue, 7 Mar 2023 18:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678214389; bh=7oRs06MOKabU/AB0P/fGhK/4WWAyhir/j7o4cOqjFSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w/SCruR3yGGSv3ZITajY9m4yBchaWvhZc1LmLrJRHDIWB+KFgiFBLM5wQ0Du8BvKe cm9sSBrD6BiRNjlQquUei3KCxbjzLf903H3UIiLVp20NRzLB9nih5g97Ld/DH3qhBI u4kY09ppZ4cTRL1k9mWFsTyl0MkxVWdmjSaVnu1w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikulas Patocka , Sweet Tea Dorminy , Mike Snitzer Subject: [PATCH 6.1 807/885] dm flakey: fix a bug with 32-bit highmem systems Date: Tue, 7 Mar 2023 18:02:21 +0100 Message-Id: <20230307170036.949279200@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mikulas Patocka commit 8eb29c4fbf9661e6bd4dd86197a37ffe0ecc9d50 upstream. The function page_address does not work with 32-bit systems with high memory. Use bvec_kmap_local/kunmap_local instead. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Reviewed-by: Sweet Tea Dorminy Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-flakey.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -307,8 +307,9 @@ static void corrupt_bio_data(struct bio struct page *page = bio_iter_page(bio, iter); if (unlikely(page == ZERO_PAGE(0))) break; - segment = (page_address(page) + bio_iter_offset(bio, iter)); + segment = bvec_kmap_local(&bvec); segment[corrupt_bio_byte] = fc->corrupt_bio_value; + kunmap_local(segment); DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n", bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,