Commit 3e593cf7 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Map the page instead of using page_address() before writing to it in

      fs/ntfs/aops.c::ntfs_mft_writepage().
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 8b393108
......@@ -80,6 +80,8 @@ ToDo/Notes:
the bug check from fs/ntfs/aops.c::ntfs_write_mst_block(). It is in
fact required to write outside initialized size when preparing to
extend the initialized size.
- Map the page instead of using page_address() before writing to it in
fs/ntfs/aops.c::ntfs_mft_writepage().
2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
......
......@@ -917,7 +917,7 @@ static int ntfs_write_mst_block(struct writeback_control *wbc,
if (!nr_bhs)
goto done;
/* Apply the mst protection fixups. */
kaddr = page_address(page);
kaddr = kmap(page);
for (i = 0; i < nr_bhs; i++) {
if (!(i % bhs_per_rec)) {
err = pre_write_mst_fixup((NTFS_RECORD*)(kaddr +
......@@ -974,6 +974,7 @@ static int ntfs_write_mst_block(struct writeback_control *wbc,
bh_offset(bhs[i])));
}
flush_dcache_page(page);
kunmap(page);
if (unlikely(err)) {
/* I/O error during writing. This is really bad! */
ntfs_error(vol->sb, "I/O error while writing ntfs record "
......@@ -996,6 +997,7 @@ static int ntfs_write_mst_block(struct writeback_control *wbc,
post_write_mst_fixup((NTFS_RECORD*)(kaddr +
bh_offset(bhs[i])));
}
kunmap(page);
cleanup_out:
/* Clean the buffers. */
for (i = 0; i < nr_bhs; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment