From 3e593cf74a35e04bd556af681965fd90b96c47df Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Tue, 12 Oct 2004 11:21:04 +0100 Subject: [PATCH] NTFS: Map the page instead of using page_address() before writing to it in fs/ntfs/aops.c::ntfs_mft_writepage(). Signed-off-by: Anton Altaparmakov --- fs/ntfs/ChangeLog | 2 ++ fs/ntfs/aops.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index bbd8335ba83d9..a3ded99e9a028 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -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. diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 6070fe0341b59..e3fb4ef6f3624 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c @@ -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++) -- 2.53.0