Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1839639pxb; Fri, 5 Mar 2021 00:28:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLc6Sc5wlw72JydQSs2vj4jfDFUCaMhNI9tleSbAhBxJUsxrQbvW3Y8c020/uDKHNgFlNi X-Received: by 2002:a92:d7ce:: with SMTP id g14mr7336485ilq.255.1614932896854; Fri, 05 Mar 2021 00:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614932896; cv=none; d=google.com; s=arc-20160816; b=sI5aYMBipoYfy5SB7HlfqCW+vT/5fJt246KJu+R2NYbwq479rzMPnTrecK7AacIc9k EAtvfQ3Afz5DKPWxNWBE0Fa4ppTZlLVt3muTY0Nj5LMsV1FbFCeBlCiu9oUSdugXqURb KGCkc/GfxACJaHrY9y8SxH1LcN6C//4qha8aLTQBSe/wsdPC334wAcN09YrkW7tTWqYe hD4dLV/Hr8Il5+fd7VCWdEZ4Jt5z6409yZMCGFEpuNC0oF8EZiDO5bMYwePIr3qP1b4R 6Ms7Vk6zrhtWPoLOYIDpKWfOXy+WRpI1YPFzWPSKe8O5sl0uM2XyV/T2vyfHGrAVQxre LIwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3O5Qsu9aTmAiL3xhmpAoPJanNgdQOxAcmhotp0BjoJ4=; b=xtPRxgSGF0XSjpY0xFksSYhaKdzQaAns8JvRjVMfuybw+dTeLTPsdE8gVp+7J+MnD3 poSxKgMrMiMFicujBlwxZGteeWZbYwnBAyhI1+Ycnbyl0OO/cEFMCVIh/VIhRrkb4BIF 5rZRa60jR4vq9VMA6y9IgczFMf4IDlHCA+2LBzJLCTgvlyc46ekVb/7PWsFP/GBbH9Yv qSdpBeRH0E3z5PlTNDsjg7fKzmbyEmebTZcEzkal7xBLPbQO5DODn8E5wQJBtXzuuKPl xw+s8ykvvTwi0QzJeD5N6uKqgWA0buEF/ueOAhQbKUtYSsi/3WWYBvVqAevE6wbViHxR 4GYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rmTOuV1d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si1936686iog.2.2021.03.05.00.28.03; Fri, 05 Mar 2021 00:28:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rmTOuV1d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229464AbhCEI1L (ORCPT + 99 others); Fri, 5 Mar 2021 03:27:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:47412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbhCEI1L (ORCPT ); Fri, 5 Mar 2021 03:27:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 502B265014; Fri, 5 Mar 2021 08:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614932830; bh=BOASgRiX/anyBYwyGt5CoZ1avHZlm10qLQx9FzJQMQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rmTOuV1dgAPy4LsKiOB1P2ZRT8wBd6gxH+xJMcSDY+xbjp76e+87zg4v4Sh3L6DmF PlS3kc4euNYVnjiGvdpSIlCYDaUlIsyfifKhLdKW32m+u+0A1JXKophgL8+7zRGN3v sOFf1PIFHxcSaXCbqlVnX87jKkOOfWOv3ONtHfCo= Date: Fri, 5 Mar 2021 09:27:08 +0100 From: Greg Kroah-Hartman To: Anthony Iliopoulos Cc: Jens Axboe , Andrew Morton , Matthew Wilcox , stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH STABLE 5.10 5.11] swap: fix swapfile page to sector mapping Message-ID: References: <20210304150824.29878-1-ailiop@suse.com> <20210304150824.29878-5-ailiop@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 10:17:08PM +0100, Anthony Iliopoulos wrote: > On Thu, Mar 04, 2021 at 05:58:49PM +0100, Greg Kroah-Hartman wrote: > > On Thu, Mar 04, 2021 at 05:30:00PM +0100, Anthony Iliopoulos wrote: > > > On Thu, Mar 04, 2021 at 04:16:26PM +0100, Greg Kroah-Hartman wrote: > > > > On Thu, Mar 04, 2021 at 04:08:24PM +0100, Anthony Iliopoulos wrote: > > > > > commit caf6912f3f4af7232340d500a4a2008f81b93f14 upstream. > > > > > > > > No, this does not look like that commit. > > > > > > > > Why can I not just take caf6912f3f4a ("swap: fix swapfile read/write > > > > offset") directly for 5.10 and 5.11? WHat has changed to prevent that? > > > > > > You're right of course, the upstream fix applies even on v5.4 so you > > > could just take it directly for those branches if this is preferable. > > > > But, that commit says it fixes 48d15436fde6 ("mm: remove get_swap_bio"), > > which is NOT what you are saying here in these patches. > > It is admittedly a bit confusing as the upstream commit fixes two issues > in one swoop: > > - the bug which was introduced in v5.12-rc1 via 48d15436fde6 ("mm: > remove get_swap_bio"), which affected swapfiles running on regular > block devices, in addition to: > > - an identical bug which up until 48d15436fde6 was only applicable to > swapfiles on top of blockdevs that can do page io without the block > layer, which was introduced with dd6bd0d9c7db ("swap: use > bdev_read_page() / bdev_write_page()") > > > So which is it? Is there a problem in 5.11 and older kernels > > (48d15436fde6 ("mm: remove get_swap_bio") showed up in 5.12-rc1), that > > requires this fix, or is there nothing needed to be backported? > > The second point/bug mentioned above is present on 5.11 and all older > kernels, so some form of this fix is required. > > > As a note, I've been running swapfiles on 5.11 and earlier just fine for > > a very long time now, so is this really an issue? > > Yes there is an issue on all kernels since v3.16-rc1 when dd6bd0d9c7db > was introduced, but it is applicable only to setups with swapfiles on > filesystems sitting on top of brd, zram, btt or pmem. > > I can trivially reproduce this e.g. on v5.11 by creating a swapfile on > top of a zram or pmem blockdev and pushing the system to swap out pages, > at which point it corrupts filesystem blocks that don't belong to the > swapfile. Ok, thanks for the detailed description, all now queued up. greg k-h