From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Sat, 7 Jul 2018 11:39:04 +0200 Subject: [Cluster-devel] [PATCH 3/3] gfs2: use iomap_readpage for blocksize == PAGE_SIZE In-Reply-To: <20180707093904.23177-1-agruenba@redhat.com> References: <20180707093904.23177-1-agruenba@redhat.com> Message-ID: <20180707093904.23177-4-agruenba@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit We only use iomap_readpage for pages that don't have buffer heads attached yet: iomap_readpage would otherwise read pages from disk that are marked buffer_uptodate() but not PageUptodate(). Those pages may actually contain data more recent than what's on disk. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/aops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index cc80fd71f3dd..31e8270d0b26 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -508,9 +508,13 @@ static int __gfs2_readpage(void *file, struct page *page) { struct gfs2_inode *ip = GFS2_I(page->mapping->host); struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host); + int error; - if (gfs2_is_stuffed(ip)) { + if (i_blocksize(page->mapping->host) == PAGE_SIZE && + !page_has_buffers(page)) { + error = iomap_readpage(page, &gfs2_iomap_ops); + } else if (gfs2_is_stuffed(ip)) { error = stuffed_readpage(ip, page); unlock_page(page); } else { -- 2.17.1