Skip to content

Commit

Permalink
gfs2: use iomap_readpage for blocksize == PAGE_SIZE
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Bob Peterson <[email protected]>
  • Loading branch information
Andreas Gruenbacher committed Jul 24, 2018
1 parent 1d45bb7 commit f95cbb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/gfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f95cbb4

Please sign in to comment.