lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 29 Oct 2015 11:43:56 -0700 (PDT)
From:	Hugh Dickins <hughd@...gle.com>
To:	Boaz Harrosh <ooo@...ctrozaur.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Benny Halevy <bhalevy@...marydata.com>,
	Trond Myklebust <trond.myklebust@...marydata.com>,
	Christoph Lameter <cl@...ux.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-nfs@...r.kernel.org, linux-mm@...ck.org, osd-dev@...n-osd.org
Subject: [PATCH] osd fs: __r4w_get_page rely on PageUptodate for uptodate

Patch "mm: migrate dirty page without clear_page_dirty_for_io etc",
presently staged in mmotm and linux-next, simplifies the migration of
a PageDirty pagecache page: one stat needs moving from zone to zone
and that's about all.

It's convenient and safest for it to shift the PageDirty bit from old
page to new, just before updating the zone stats: before copying data
and marking the new PageUptodate.  This is all done while both pages
are isolated and locked, just as before; and just as before, there's
a moment when the new page is visible in the radix_tree, but not yet
PageUptodate.  What's new is that it may now be briefly visible as
PageDirty before it is PageUptodate.

When I scoured the tree to see if this could cause a problem anywhere,
the only places I found were in two similar functions __r4w_get_page():
which look up a page with find_get_page() (not using page lock), then
claim it's uptodate if it's PageDirty or PageWriteback or PageUptodate.

I'm not sure whether that was right before, but now it might be wrong
(on rare occasions): only claim the page is uptodate if PageUptodate.
Or perhaps the page in question could never be migratable anyway?

Signed-off-by: Hugh Dickins <hughd@...gle.com>
---

 fs/exofs/inode.c             |    5 +----
 fs/nfs/objlayout/objio_osd.c |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

--- 4.3-next/fs/exofs/inode.c	2015-08-30 11:34:09.000000000 -0700
+++ linux/fs/exofs/inode.c	2015-10-28 16:55:18.795554294 -0700
@@ -592,10 +592,7 @@ static struct page *__r4w_get_page(void
 			}
 			unlock_page(page);
 		}
-		if (PageDirty(page) || PageWriteback(page))
-			*uptodate = true;
-		else
-			*uptodate = PageUptodate(page);
+		*uptodate = PageUptodate(page);
 		EXOFS_DBGMSG2("index=0x%lx uptodate=%d\n", index, *uptodate);
 		return page;
 	} else {
--- 4.3-next/fs/nfs/objlayout/objio_osd.c	2015-10-21 18:35:07.620645439 -0700
+++ linux/fs/nfs/objlayout/objio_osd.c	2015-10-28 16:53:55.083686639 -0700
@@ -476,10 +476,7 @@ static struct page *__r4w_get_page(void
 		}
 		unlock_page(page);
 	}
-	if (PageDirty(page) || PageWriteback(page))
-		*uptodate = true;
-	else
-		*uptodate = PageUptodate(page);
+	*uptodate = PageUptodate(page);
 	dprintk("%s: index=0x%lx uptodate=%d\n", __func__, index, *uptodate);
 	return page;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ