summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-19 09:23:07 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:57 -0400
commitbbf0d0062da2b3e1e239e381f8ac20971ef1b2ed (patch)
tree6102eca045793cf1384d39d2fb2061f4dd3d23d8
parent0a2118dfd4c328e8823cdcfebf839dff73ac21e9 (diff)
downloadlinux-bbf0d0062da2b3e1e239e381f8ac20971ef1b2ed.tar.bz2
Btrfs: KM_IRQ0 usage in end_io handling
endio handling is typically called with interrupts disabled, but can also be called with it enabled. So save interrupts before using KM_IRQ0 to be completely safe. Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0e1ca423e22d..02d802cdd59b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -168,8 +168,10 @@ int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end)
int ret;
struct btrfs_root *root = BTRFS_I(inode)->root;
u32 csum = ~(u32)0;
+ unsigned long flags;
ret = get_state_private(em_tree, start, &private);
+ local_irq_save(flags);
kaddr = kmap_atomic(page, KM_IRQ0);
if (ret) {
goto zeroit;
@@ -180,6 +182,7 @@ int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end)
goto zeroit;
}
kunmap_atomic(kaddr, KM_IRQ0);
+ local_irq_restore(flags);
return 0;
zeroit:
@@ -188,6 +191,7 @@ zeroit:
memset(kaddr + offset, 1, end - start + 1);
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_IRQ0);
+ local_irq_restore(flags);
return 0;
}