Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:48738 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389447AbeLQU3H (ORCPT ); Mon, 17 Dec 2018 15:29:07 -0500 Date: Mon, 17 Dec 2018 12:29:05 -0800 From: akpm@linux-foundation.org To: bfoster@redhat.com, darrick.wong@oracle.com, hch@lst.de, mm-commits@vger.kernel.org, pjaroszynski@nvidia.com, stable@vger.kernel.org, william.kucharski@oracle.com Subject: [merged] iomap-get-put-the-page-in-iomap_page_create-release.patch removed from -mm tree Message-ID: <20181217202905.HJFudBjip%akpm@linux-foundation.org> Sender: stable-owner@vger.kernel.org List-ID: The patch titled Subject: fs/iomap.c: get/put the page in iomap_page_create/release() has been removed from the -mm tree. Its filename was iomap-get-put-the-page-in-iomap_page_create-release.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Piotr Jaroszynski Subject: fs/iomap.c: get/put the page in iomap_page_create/release() migrate_page_move_mapping() expects pages with private data set to have a page_count elevated by 1. This is what used to happen for xfs through the buffer_heads code before the switch to iomap in commit 82cb14175e7d ("xfs: add support for sub-pagesize writeback without buffer_heads"). Not having the count elevated causes move_pages() to fail on memory mapped files coming from xfs. Make iomap compatible with the migrate_page_move_mapping() assumption by elevating the page count as part of iomap_page_create() and lowering it in iomap_page_release(). It causes the move_pages() syscall to misbehave on memory mapped files from xfs. It does not not move any pages, which I suppose is "just" a perf issue, but it also ends up returning a positive number which is out of spec for the syscall. Talking to Michal Hocko, it sounds like returning positive numbers might be a necessary update to move_pages() anyway though (https://lkml.kernel.org/r/20181116114955.GJ14706@dhcp22.suse.cz). I only hit this in tests that verify that move_pages() actually moved the pages. The test also got confused by the positive return from move_pages() (it got treated as a success as positive numbers were not expected and not handled) making it a bit harder to track down what's going on. Link: http://lkml.kernel.org/r/20181115184140.1388751-1-pjaroszynski@nvidia.com Fixes: 82cb14175e7d ("xfs: add support for sub-pagesize writeback without buffer_heads") Signed-off-by: Piotr Jaroszynski Reviewed-by: Christoph Hellwig Cc: William Kucharski Cc: Darrick J. Wong Cc: Brian Foster Cc: Signed-off-by: Andrew Morton --- fs/iomap.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/iomap.c~iomap-get-put-the-page-in-iomap_page_create-release +++ a/fs/iomap.c @@ -116,6 +116,12 @@ iomap_page_create(struct inode *inode, s atomic_set(&iop->read_count, 0); atomic_set(&iop->write_count, 0); bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE); + + /* + * migrate_page_move_mapping() assumes that pages with private data have + * their count elevated by 1. + */ + get_page(page); set_page_private(page, (unsigned long)iop); SetPagePrivate(page); return iop; @@ -132,6 +138,7 @@ iomap_page_release(struct page *page) WARN_ON_ONCE(atomic_read(&iop->write_count)); ClearPagePrivate(page); set_page_private(page, 0); + put_page(page); kfree(iop); } _ Patches currently in -mm which might be from pjaroszynski@nvidia.com are