From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA87E1172C for ; Tue, 2 Jan 2024 14:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Iq3djF4i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D9DDC433C7; Tue, 2 Jan 2024 14:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704205928; bh=7YcOpGo4fq3XZK3V9Mkqw15RjNqW9bR8ufcQqvdz2N8=; h=Subject:To:Cc:From:Date:From; b=Iq3djF4iDTuNw8gbdh/LB07LQiZWhNw2HPwByjpw18MPldzI8a5JBeGEZ3mZpNytA /jZcaW0+/jPWy7bt9iVr+pFLRkWU2y1xJ6PLnboRCKGb+16S6OY9iLcxaH/3JImdQE QBOSv2YLZaChQXs5JR87xketZUzNfS+kDtz0O+zo= Subject: FAILED: patch "[PATCH] mm/memory-failure: cast index to loff_t before shifting it" failed to apply to 5.10-stable tree To: willy@infradead.org,akpm@linux-foundation.org,dan.j.williams@intel.com,n-horiguchi@ah.jp.nec.com,stable@vger.kernel.org Cc: From: Date: Tue, 02 Jan 2024 15:31:56 +0100 Message-ID: <2024010256-charity-crescent-3575@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-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 . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 39ebd6dce62d8cfe3864e16148927a139f11bc9a # git commit -s git send-email --to '' --in-reply-to '2024010256-charity-crescent-3575@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 39ebd6dce62d ("mm/memory-failure: cast index to loff_t before shifting it") 00cc790e0036 ("mm: factor helpers for memory_failure_dev_pagemap") f25cbb7a95a2 ("mm: add zone device coherent type memory support") 034e5afad921 ("mm: re-allow pinning of zero pfns") 1c563432588d ("mm: fix is_pinnable_page against a cma page") 405ce051236c ("mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb()") 9030fb0bb9d6 ("Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 39ebd6dce62d8cfe3864e16148927a139f11bc9a Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Mon, 18 Dec 2023 13:58:37 +0000 Subject: [PATCH] mm/memory-failure: cast index to loff_t before shifting it On 32-bit systems, we'll lose the top bits of index because arithmetic will be performed in unsigned long instead of unsigned long long. This affects files over 4GB in size. Link: https://lkml.kernel.org/r/20231218135837.3310403-4-willy@infradead.org Fixes: 6100e34b2526 ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages") Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 82e15baabb48..455093f73a70 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1704,7 +1704,7 @@ static void unmap_and_kill(struct list_head *to_kill, unsigned long pfn, * mapping being torn down is communicated in siginfo, see * kill_proc() */ - loff_t start = (index << PAGE_SHIFT) & ~(size - 1); + loff_t start = ((loff_t)index << PAGE_SHIFT) & ~(size - 1); unmap_mapping_range(mapping, start, size, 0); }