]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
gfs2: use iomap_readpage for blocksize == PAGE_SIZE
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 6 Jun 2018 19:30:38 +0000 (20:30 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Jul 2018 22:08:49 +0000 (00:08 +0200)
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 <agruenba@redhat.com>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/aops.c

index cc80fd71f3dd5c438c30f8e488d40ede6eb4ee0e..31e8270d0b2661405be1ab6dff3ac3833030fda8 100644 (file)
@@ -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 {