mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
gfs2: jdata writepage fix
[ Upstream commitcbb60951ce] 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:18ec7d5c3f("[GFS2] Make journaled data files identical to normal files on disk") Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cfd85a0922
commit
deece7bd60
@@ -152,7 +152,6 @@ static int __gfs2_jdata_writepage(struct page *page, struct writeback_control *w
|
|||||||
{
|
{
|
||||||
struct inode *inode = page->mapping->host;
|
struct inode *inode = page->mapping->host;
|
||||||
struct gfs2_inode *ip = GFS2_I(inode);
|
struct gfs2_inode *ip = GFS2_I(inode);
|
||||||
struct gfs2_sbd *sdp = GFS2_SB(inode);
|
|
||||||
|
|
||||||
if (PageChecked(page)) {
|
if (PageChecked(page)) {
|
||||||
ClearPageChecked(page);
|
ClearPageChecked(page);
|
||||||
@@ -160,7 +159,7 @@ static int __gfs2_jdata_writepage(struct page *page, struct writeback_control *w
|
|||||||
create_empty_buffers(page, inode->i_sb->s_blocksize,
|
create_empty_buffers(page, inode->i_sb->s_blocksize,
|
||||||
BIT(BH_Dirty)|BIT(BH_Uptodate));
|
BIT(BH_Dirty)|BIT(BH_Uptodate));
|
||||||
}
|
}
|
||||||
gfs2_page_add_databufs(ip, page, 0, sdp->sd_vfs->s_blocksize);
|
gfs2_page_add_databufs(ip, page, 0, PAGE_SIZE);
|
||||||
}
|
}
|
||||||
return gfs2_write_jdata_page(page, wbc);
|
return gfs2_write_jdata_page(page, wbc);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user