aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2009-09-16 05:50:16 -0400
committerAndi Kleen <ak@linux.intel.com>2009-09-16 05:50:16 -0400
commitaa261f549d7652258331ebb12795f3bc4395d213 (patch)
tree0ca807db32a6e3f213fa52b5a053d2b27e5e6bac /fs
parent6a46079cf57a7f7758e8b926980a4f852f89b34d (diff)
HWPOISON: Enable .remove_error_page for migration aware file systems
Enable removing of corrupted pages through truncation for a bunch of file systems: ext*, xfs, gfs2, ocfs2, ntfs These should cover most server needs. I chose the set of migration aware file systems for this for now, assuming they have been especially audited. But in general it should be safe for all file systems on the data area that support read/write and truncate. Caveat: the hardware error handler does not take i_mutex for now before calling the truncate function. Is that ok? Cc: tytso@mit.edu Cc: hch@infradead.org Cc: mfasheh@suse.com Cc: aia21@cantab.net Cc: hugh.dickins@tiscali.co.uk Cc: swhiteho@redhat.com Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext2/inode.c2
-rw-r--r--fs/ext3/inode.c3
-rw-r--r--fs/ext4/inode.c4
-rw-r--r--fs/gfs2/aops.c3
-rw-r--r--fs/ntfs/aops.c2
-rw-r--r--fs/ocfs2/aops.c1
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c1
7 files changed, 16 insertions, 0 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 1c1638f873a4..ade634076d0a 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -819,6 +819,7 @@ const struct address_space_operations ext2_aops = {
819 .writepages = ext2_writepages, 819 .writepages = ext2_writepages,
820 .migratepage = buffer_migrate_page, 820 .migratepage = buffer_migrate_page,
821 .is_partially_uptodate = block_is_partially_uptodate, 821 .is_partially_uptodate = block_is_partially_uptodate,
822 .error_remove_page = generic_error_remove_page,
822}; 823};
823 824
824const struct address_space_operations ext2_aops_xip = { 825const struct address_space_operations ext2_aops_xip = {
@@ -837,6 +838,7 @@ const struct address_space_operations ext2_nobh_aops = {
837 .direct_IO = ext2_direct_IO, 838 .direct_IO = ext2_direct_IO,
838 .writepages = ext2_writepages, 839 .writepages = ext2_writepages,
839 .migratepage = buffer_migrate_page, 840 .migratepage = buffer_migrate_page,
841 .error_remove_page = generic_error_remove_page,
840}; 842};
841 843
842/* 844/*
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index b49908a167ae..953b430f92e3 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1819,6 +1819,7 @@ static const struct address_space_operations ext3_ordered_aops = {
1819 .direct_IO = ext3_direct_IO, 1819 .direct_IO = ext3_direct_IO,
1820 .migratepage = buffer_migrate_page, 1820 .migratepage = buffer_migrate_page,
1821 .is_partially_uptodate = block_is_partially_uptodate, 1821 .is_partially_uptodate = block_is_partially_uptodate,
1822 .error_remove_page = generic_error_remove_page,
1822}; 1823};
1823 1824
1824static const struct address_space_operations ext3_writeback_aops = { 1825static const struct address_space_operations ext3_writeback_aops = {
@@ -1834,6 +1835,7 @@ static const struct address_space_operations ext3_writeback_aops = {
1834 .direct_IO = ext3_direct_IO, 1835 .direct_IO = ext3_direct_IO,
1835 .migratepage = buffer_migrate_page, 1836 .migratepage = buffer_migrate_page,
1836 .is_partially_uptodate = block_is_partially_uptodate, 1837 .is_partially_uptodate = block_is_partially_uptodate,
1838 .error_remove_page = generic_error_remove_page,
1837}; 1839};
1838 1840
1839static const struct address_space_operations ext3_journalled_aops = { 1841static const struct address_space_operations ext3_journalled_aops = {
@@ -1848,6 +1850,7 @@ static const struct address_space_operations ext3_journalled_aops = {
1848 .invalidatepage = ext3_invalidatepage, 1850 .invalidatepage = ext3_invalidatepage,
1849 .releasepage = ext3_releasepage, 1851 .releasepage = ext3_releasepage,
1850 .is_partially_uptodate = block_is_partially_uptodate, 1852 .is_partially_uptodate = block_is_partially_uptodate,
1853 .error_remove_page = generic_error_remove_page,
1851}; 1854};
1852 1855
1853void ext3_set_aops(struct inode *inode) 1856void ext3_set_aops(struct inode *inode)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index f9c642b22efa..349dd6b4da47 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3373,6 +3373,7 @@ static const struct address_space_operations ext4_ordered_aops = {
3373 .direct_IO = ext4_direct_IO, 3373 .direct_IO = ext4_direct_IO,
3374 .migratepage = buffer_migrate_page, 3374 .migratepage = buffer_migrate_page,
3375 .is_partially_uptodate = block_is_partially_uptodate, 3375 .is_partially_uptodate = block_is_partially_uptodate,
3376 .error_remove_page = generic_error_remove_page,
3376}; 3377};
3377 3378
3378static const struct address_space_operations ext4_writeback_aops = { 3379static const struct address_space_operations ext4_writeback_aops = {
@@ -3388,6 +3389,7 @@ static const struct address_space_operations ext4_writeback_aops = {
3388 .direct_IO = ext4_direct_IO, 3389 .direct_IO = ext4_direct_IO,
3389 .migratepage = buffer_migrate_page, 3390 .migratepage = buffer_migrate_page,
3390 .is_partially_uptodate = block_is_partially_uptodate, 3391 .is_partially_uptodate = block_is_partially_uptodate,
3392 .error_remove_page = generic_error_remove_page,
3391}; 3393};
3392 3394
3393static const struct address_space_operations ext4_journalled_aops = { 3395static const struct address_space_operations ext4_journalled_aops = {
@@ -3402,6 +3404,7 @@ static const struct address_space_operations ext4_journalled_aops = {
3402 .invalidatepage = ext4_invalidatepage, 3404 .invalidatepage = ext4_invalidatepage,
3403 .releasepage = ext4_releasepage, 3405 .releasepage = ext4_releasepage,
3404 .is_partially_uptodate = block_is_partially_uptodate, 3406 .is_partially_uptodate = block_is_partially_uptodate,
3407 .error_remove_page = generic_error_remove_page,
3405}; 3408};
3406 3409
3407static const struct address_space_operations ext4_da_aops = { 3410static const struct address_space_operations ext4_da_aops = {
@@ -3418,6 +3421,7 @@ static const struct address_space_operations ext4_da_aops = {
3418 .direct_IO = ext4_direct_IO, 3421 .direct_IO = ext4_direct_IO,
3419 .migratepage = buffer_migrate_page, 3422 .migratepage = buffer_migrate_page,
3420 .is_partially_uptodate = block_is_partially_uptodate, 3423 .is_partially_uptodate = block_is_partially_uptodate,
3424 .error_remove_page = generic_error_remove_page,
3421}; 3425};
3422 3426
3423void ext4_set_aops(struct inode *inode) 3427void ext4_set_aops(struct inode *inode)
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 7ebae9a4ecc0..694b5d48f036 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1135,6 +1135,7 @@ static const struct address_space_operations gfs2_writeback_aops = {
1135 .direct_IO = gfs2_direct_IO, 1135 .direct_IO = gfs2_direct_IO,
1136 .migratepage = buffer_migrate_page, 1136 .migratepage = buffer_migrate_page,
1137 .is_partially_uptodate = block_is_partially_uptodate, 1137 .is_partially_uptodate = block_is_partially_uptodate,
1138 .error_remove_page = generic_error_remove_page,
1138}; 1139};
1139 1140
1140static const struct address_space_operations gfs2_ordered_aops = { 1141static const struct address_space_operations gfs2_ordered_aops = {
@@ -1151,6 +1152,7 @@ static const struct address_space_operations gfs2_ordered_aops = {
1151 .direct_IO = gfs2_direct_IO, 1152 .direct_IO = gfs2_direct_IO,
1152 .migratepage = buffer_migrate_page, 1153 .migratepage = buffer_migrate_page,
1153 .is_partially_uptodate = block_is_partially_uptodate, 1154 .is_partially_uptodate = block_is_partially_uptodate,
1155 .error_remove_page = generic_error_remove_page,
1154}; 1156};
1155 1157
1156static const struct address_space_operations gfs2_jdata_aops = { 1158static const struct address_space_operations gfs2_jdata_aops = {
@@ -1166,6 +1168,7 @@ static const struct address_space_operations gfs2_jdata_aops = {
1166 .invalidatepage = gfs2_invalidatepage, 1168 .invalidatepage = gfs2_invalidatepage,
1167 .releasepage = gfs2_releasepage, 1169 .releasepage = gfs2_releasepage,
1168 .is_partially_uptodate = block_is_partially_uptodate, 1170 .is_partially_uptodate = block_is_partially_uptodate,
1171 .error_remove_page = generic_error_remove_page,
1169}; 1172};
1170 1173
1171void gfs2_set_aops(struct inode *inode) 1174void gfs2_set_aops(struct inode *inode)
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index b38f944f0667..cfce53cb65d7 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -1550,6 +1550,7 @@ const struct address_space_operations ntfs_aops = {
1550 .migratepage = buffer_migrate_page, /* Move a page cache page from 1550 .migratepage = buffer_migrate_page, /* Move a page cache page from
1551 one physical page to an 1551 one physical page to an
1552 other. */ 1552 other. */
1553 .error_remove_page = generic_error_remove_page,
1553}; 1554};
1554 1555
1555/** 1556/**
@@ -1569,6 +1570,7 @@ const struct address_space_operations ntfs_mst_aops = {
1569 .migratepage = buffer_migrate_page, /* Move a page cache page from 1570 .migratepage = buffer_migrate_page, /* Move a page cache page from
1570 one physical page to an 1571 one physical page to an
1571 other. */ 1572 other. */
1573 .error_remove_page = generic_error_remove_page,
1572}; 1574};
1573 1575
1574#ifdef NTFS_RW 1576#ifdef NTFS_RW
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 8a1e61545f41..747f15eefd82 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1997,4 +1997,5 @@ const struct address_space_operations ocfs2_aops = {
1997 .releasepage = ocfs2_releasepage, 1997 .releasepage = ocfs2_releasepage,
1998 .migratepage = buffer_migrate_page, 1998 .migratepage = buffer_migrate_page,
1999 .is_partially_uptodate = block_is_partially_uptodate, 1999 .is_partially_uptodate = block_is_partially_uptodate,
2000 .error_remove_page = generic_error_remove_page,
2000}; 2001};
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index aecf2519db76..52f3fc63571a 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1636,4 +1636,5 @@ const struct address_space_operations xfs_address_space_operations = {
1636 .direct_IO = xfs_vm_direct_IO, 1636 .direct_IO = xfs_vm_direct_IO,
1637 .migratepage = buffer_migrate_page, 1637 .migratepage = buffer_migrate_page,
1638 .is_partially_uptodate = block_is_partially_uptodate, 1638 .is_partially_uptodate = block_is_partially_uptodate,
1639 .error_remove_page = generic_error_remove_page,
1639}; 1640};