Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 8 Sep 2002 18:30:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 8 Sep 2002 18:30:30 -0400 Received: from purple.csi.cam.ac.uk ([131.111.8.4]:40916 "EHLO purple.csi.cam.ac.uk") by vger.kernel.org with ESMTP id ; Sun, 8 Sep 2002 18:30:28 -0400 Subject: NTFS: Fixup NTFS after kmap() changes in generic_file_write() To: torvalds@transmeta.com (Linus Torvalds) Date: Sun, 8 Sep 2002 23:35:10 +0100 (BST) Cc: linux-kernel@vger.kernel.org (Linux Kernel) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: From: Anton Altaparmakov Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5496 Lines: 145 Linus, please do a bk pull http://linux-ntfs.bkbits.net/ntfs-2.5 This is urgent as NTFS will die horribly on highmem boxes without this patch since it relies on the page already being kmapped in ->prepare/commit_write() and this is no longer the case... Thanks! Best regards, Anton -- Anton Altaparmakov (replace at with @) Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/ =================================================================== This will update the following files: fs/ntfs/aops.c | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) through these ChangeSets: (02/09/08 1.575) NTFS: Pages are no longer kmapped around calls to ->{prepare,commit}_write, adapt NTFS appropriately. diff -Nru a/fs/ntfs/aops.c b/fs/ntfs/aops.c --- a/fs/ntfs/aops.c Sun Sep 8 23:07:14 2002 +++ b/fs/ntfs/aops.c Sun Sep 8 23:07:14 2002 @@ -1018,7 +1018,6 @@ ntfs_volume *vol; run_list_element *rl; struct buffer_head *bh, *head, *wait[2], **wait_bh = wait; - char *kaddr = page_address(page); unsigned int vcn_ofs, block_start, block_end, blocksize; int err; BOOL is_retry; @@ -1267,13 +1266,20 @@ * region. NOTE: This is how we decide if to * zero or not! */ - if (block_end > to) - memset(kaddr + to, 0, block_end - to); - if (block_start < from) - memset(kaddr + block_start, 0, - from - block_start); - if (block_end > to || block_start < from) + if (block_end > to || block_start < from) { + void *kaddr; + + kaddr = kmap_atomic(page, KM_USER0); + if (block_end > to) + memset(kaddr + to, 0, + block_end - to); + if (block_start < from) + memset(kaddr + block_start, 0, + from - + block_start); flush_dcache_page(page); + kunmap_atomic(kaddr, KM_USER0); + } continue; } } @@ -1330,10 +1336,14 @@ if (block_start >= to) break; if (buffer_new(bh)) { + void *kaddr; + clear_buffer_new(bh); if (buffer_uptodate(bh)) buffer_error(); + kaddr = kmap_atomic(page, KM_USER0); memset(kaddr + block_start, 0, bh->b_size); + kunmap_atomic(kaddr, KM_USER0); set_buffer_uptodate(bh); mark_buffer_dirty(bh); is_retry = TRUE; =================================================================== This BitKeeper patch contains the following changesets: aia21@cantab.net|ChangeSet|20020908220434|13926 aia21@cantab.net|ChangeSet|20020908212947|13911 aia21@cantab.net|ChangeSet|20020907104127|04876 aia21@cantab.net|ChangeSet|20020901002342|24934 aia21@cantab.net|ChangeSet|20020831172741|21789 ## Wrapped with gzip_uu ## begin 664 bkpatch31569 M'XL(`!/*>ST``]59:W/;QA7]3/R*GA;XCO[R>3^JBW)MM M4BU,O=X6N5^7)J\R6QL_+K+VQ[7)5_:]K5M.*<<_Q4)!5="R@,JPC5G"F)', M)I1+'4CO._*ALN5\8E+#&3[]O:CJ^20V>6V6?FYKW'I7%+@U:ZIR5I7Q+*_/ MJRGWE8=';TT=K\G>EM5\PGQQ^W-GYY-U/?_OPCQ_>>=[I*;FQBYR>>M]V M"YWIBUN3[RZ@!6-<B8887K.P[ED+RB;4TKNKD=> M4#*EWBOR;;G9IGGS7^=HDN9U<5#H)A0I24R^2.PR M-;E?E*M#+@@4YZI5DFD&^6VR7.#'+Y+J&"#D3'(`!(N\-X2S4$?>V5C@V]O( M>].17Y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