summaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2022-11-30 14:58:42 -0800
committerAndrew Morton <akpm@linux-foundation.org>2022-11-30 14:58:42 -0800
commita38358c934f66bdff12db762998b88038d7bc44b (patch)
tree72747f34cde18a9e2188b6bccb865c14d423b986 /fs/hugetlbfs
parentea0ffd0c08d0fef1f6e93eb07badbeeabf6b43d6 (diff)
parent1d351f1894342c378b96bb9ed89f8debb1e24e9f (diff)
downloadlinux-stable-a38358c934f66bdff12db762998b88038d7bc44b.tar.gz
linux-stable-a38358c934f66bdff12db762998b88038d7bc44b.tar.bz2
linux-stable-a38358c934f66bdff12db762998b88038d7bc44b.zip
Merge branch 'mm-hotfixes-stable' into mm-stable
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r--fs/hugetlbfs/inode.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 09e644f80a4a..3ee84604e36d 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -328,6 +328,12 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to)
} else {
unlock_page(page);
+ if (PageHWPoison(page)) {
+ put_page(page);
+ retval = -EIO;
+ break;
+ }
+
/*
* We have the page, copy it to user space buffer.
*/
@@ -1111,13 +1117,6 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping,
static int hugetlbfs_error_remove_page(struct address_space *mapping,
struct page *page)
{
- struct inode *inode = mapping->host;
- pgoff_t index = page->index;
-
- hugetlb_delete_from_page_cache(page);
- if (unlikely(hugetlb_unreserve_pages(inode, index, index + 1, 1)))
- hugetlb_fix_reserve_counts(inode);
-
return 0;
}