aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/aops.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-01-30 17:36:24 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-30 19:01:35 -0500
commitfa8609da993b04dc2dd762173a6d0ab1a192e256 (patch)
treeacf6440950b722e3acdc0beba497bf0b640e588e /fs/ntfs/aops.c
parent3896625d0badd53dbc34d584861a36ba7eb4613f (diff)
[PATCH] ntfs: kmap_atomic() atomicity fix
The KM_BIO_SRC_IRQ kmap slot requires local irq protection. Acked-by: Anton Altaparmakov <aia21@cantab.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ntfs/aops.c')
-rw-r--r--fs/ntfs/aops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 7b2c8f4f6a6f..629e7abdd840 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -92,10 +92,12 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
92 ofs = 0; 92 ofs = 0;
93 if (file_ofs < init_size) 93 if (file_ofs < init_size)
94 ofs = init_size - file_ofs; 94 ofs = init_size - file_ofs;
95 local_irq_save(flags);
95 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); 96 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ);
96 memset(kaddr + bh_offset(bh) + ofs, 0, 97 memset(kaddr + bh_offset(bh) + ofs, 0,
97 bh->b_size - ofs); 98 bh->b_size - ofs);
98 kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); 99 kunmap_atomic(kaddr, KM_BIO_SRC_IRQ);
100 local_irq_restore(flags);
99 flush_dcache_page(page); 101 flush_dcache_page(page);
100 } 102 }
101 } else { 103 } else {
@@ -143,11 +145,13 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
143 recs = PAGE_CACHE_SIZE / rec_size; 145 recs = PAGE_CACHE_SIZE / rec_size;
144 /* Should have been verified before we got here... */ 146 /* Should have been verified before we got here... */
145 BUG_ON(!recs); 147 BUG_ON(!recs);
148 local_irq_save(flags);
146 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); 149 kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ);
147 for (i = 0; i < recs; i++) 150 for (i = 0; i < recs; i++)
148 post_read_mst_fixup((NTFS_RECORD*)(kaddr + 151 post_read_mst_fixup((NTFS_RECORD*)(kaddr +
149 i * rec_size), rec_size); 152 i * rec_size), rec_size);
150 kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); 153 kunmap_atomic(kaddr, KM_BIO_SRC_IRQ);
154 local_irq_restore(flags);
151 flush_dcache_page(page); 155 flush_dcache_page(page);
152 if (likely(page_uptodate && !PageError(page))) 156 if (likely(page_uptodate && !PageError(page)))
153 SetPageUptodate(page); 157 SetPageUptodate(page);