Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1631032pxb; Thu, 4 Mar 2021 16:59:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxm3j+l1TCiExMZBJKjlVCxz9gDiafIYlhqtmRfNYeJwQunLzWEOCKWo9yTMx2aY4DfHAVC X-Received: by 2002:a02:9042:: with SMTP id y2mr7089036jaf.94.1614905969272; Thu, 04 Mar 2021 16:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614905969; cv=none; d=google.com; s=arc-20160816; b=J09is5R46jKUJPe7tgBfaQg908jKDwCGdEZJ8VTPya2fjUbH7md1FYWzT231RzCH2Y uv2ztSV0dAEpxUZLXHaDcc93QdQcQzz24gQ5YuwNs4fXpStIO869dY4EEhyY5BZIGt+0 G8T/+Xa046/1zrSeEpuG4loYC76nGk1mOAVxs/vusoHvRLBKznxHzGdtogWJaoiZqLm1 pTckfKfCaMdWfbQzXE8E50QziLxETIrpCOkA52ArHVU1NrHZoYa/7cgINx9Mn/6GscbI zsfn3fJf9WSSXSQsPVSj80BXQocKSlFV0oJDr3g5wKWnWVBDeUfvxmwX4uxexOc2tJn9 79rw== 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=/tZ880Yp/AKHzG1rpWeDp9V30VjIiNL6pvc/O/61Sck=; b=TLuSA8bm5Sq80tYFKEyqIL5n7wM8sfXFrRkSllCNF1cA9bJYRrA368gkXQBVNmT7FD 2l38U9mez2F7XdIcYu8Ipw9M29DKKjZOHlYcfMagRsab0PP77eApFAccA/wQXeYIccDI ubBqwvX4ZIFWnKDGaT4uI6nhoO5QisDYftSEHHbktGC50njOvviD2bmzkAfSTLye8jbv UW6k2baGrW8L23kvjqPfpmYQCtyJsm4YWx2aZWhKohPSuzf6mBdQKfAFT6EkPFdsRGkL LuphxNaorEPxk6rUgoi/e2ia4BDkpDVISLbPGVW2zLifS6mShmis6FiiP7kXlRFweOEj mMAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="nCoW2/W4"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si805356iod.102.2021.03.04.16.59.16; Thu, 04 Mar 2021 16:59:29 -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=@suse.com header.s=susede1 header.b="nCoW2/W4"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239369AbhCDVSV (ORCPT + 99 others); Thu, 4 Mar 2021 16:18:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:51908 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234894AbhCDVR4 (ORCPT ); Thu, 4 Mar 2021 16:17:56 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614892629; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/tZ880Yp/AKHzG1rpWeDp9V30VjIiNL6pvc/O/61Sck=; b=nCoW2/W4dLR8+pG1rRhirVZ+Z9b+K4gJulKogHhl2KxAUI3Q1MY/2G1W7U3tCZTIOMpHPF 5vl7YKo1McvzNVmkXuYzU77vtyz+lrpGiKEy9WprGWE8uPhkWUWnlXAT64Z9QIcOQJ276K hQIubeeMqKJtIEjp+l2+3+97NKjOUi8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 88BD6AFB0; Thu, 4 Mar 2021 21:17:09 +0000 (UTC) Date: Thu, 4 Mar 2021 22:17:08 +0100 From: Anthony Iliopoulos To: Greg Kroah-Hartman 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 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. Regards, Anthony