+ iomap-get-put-the-page-in-iomap_page_create-release.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: fs/iomap.c: get/put the page in iomap_page_create/release()
has been added to the -mm tree.  Its filename is
     iomap-get-put-the-page-in-iomap_page_create-release.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/iomap-get-put-the-page-in-iomap_page_create-release.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/iomap-get-put-the-page-in-iomap_page_create-release.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Piotr Jaroszynski <pjaroszynski@xxxxxxxxxx>
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().

Link: http://lkml.kernel.org/r/20181115184140.1388751-1-pjaroszynski@xxxxxxxxxx
Fixes: 82cb14175e7d ("xfs: add support for sub-pagesize writeback without buffer_heads")
Signed-off-by: Piotr Jaroszynski <pjaroszynski@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Cc: William Kucharski <william.kucharski@xxxxxxxxxx>
Cc: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
Cc: Brian Foster <bfoster@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 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@xxxxxxxxxx are

iomap-get-put-the-page-in-iomap_page_create-release.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux