]> git.hungrycats.org Git - linux/commitdiff
NTFS: Map the page instead of using page_address() before writing to it in
authorAnton Altaparmakov <aia21@cantab.net>
Tue, 12 Oct 2004 10:21:04 +0000 (11:21 +0100)
committerAnton Altaparmakov <aia21@cantab.net>
Tue, 12 Oct 2004 10:21:04 +0000 (11:21 +0100)
      fs/ntfs/aops.c::ntfs_mft_writepage().

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
fs/ntfs/ChangeLog
fs/ntfs/aops.c

index bbd8335ba83d94a4941eeb7d51051585e9dd8154..a3ded99e9a0286631ae8e583bff11cbc116cc387 100644 (file)
@@ -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.
 
index 6070fe0341b59bc046b5d8590e5dc1fe71f70bfb..e3fb4ef6f3624ffa6b5ad15bbb7ba439e2387e5c 100644 (file)
@@ -917,7 +917,7 @@ no_buffers_err_out:
        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 @@ no_buffers_err_out:
                                        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 @@ mst_cleanup_out:
                        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++)