Skip to content

Commit cbb6095

Browse files
author
Andreas Gruenbacher
committed
gfs2: jdata writepage fix
The ->writepage() and ->writepages() operations are supposed to write entire pages. However, on filesystems with a block size smaller than PAGE_SIZE, __gfs2_jdata_writepage() only adds the first block to the current transaction instead of adding the entire page. Fix that. Fixes: 18ec7d5 ("[GFS2] Make journaled data files identical to normal files on disk") Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent b66f723 commit cbb6095

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/gfs2/aops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,14 @@ static int __gfs2_jdata_writepage(struct page *page, struct writeback_control *w
127127
{
128128
struct inode *inode = page->mapping->host;
129129
struct gfs2_inode *ip = GFS2_I(inode);
130-
struct gfs2_sbd *sdp = GFS2_SB(inode);
131130

132131
if (PageChecked(page)) {
133132
ClearPageChecked(page);
134133
if (!page_has_buffers(page)) {
135134
create_empty_buffers(page, inode->i_sb->s_blocksize,
136135
BIT(BH_Dirty)|BIT(BH_Uptodate));
137136
}
138-
gfs2_page_add_databufs(ip, page, 0, sdp->sd_vfs->s_blocksize);
137+
gfs2_page_add_databufs(ip, page, 0, PAGE_SIZE);
139138
}
140139
return gfs2_write_jdata_page(page, wbc);
141140
}

0 commit comments

Comments
 (0)