diff options
author | Javier Pello <javier.pello@urjc.es> | 2021-07-14 18:54:48 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-07-16 12:36:51 +0200 |
commit | 728d392f8a799f037812d0f2b254fb3b5e115fcf (patch) | |
tree | f7786885c6af432e6314b24afde73f34a8705663 /fs/ext2/ext2.h | |
parent | reiserfs: add check for root_inode in reiserfs_fill_super (diff) | |
download | linux-728d392f8a799f037812d0f2b254fb3b5e115fcf.tar.xz linux-728d392f8a799f037812d0f2b254fb3b5e115fcf.zip |
fs/ext2: Avoid page_address on pages returned by ext2_get_page
Commit 782b76d7abdf02b12c46ed6f1e9bf715569027f7 ("fs/ext2: Replace
kmap() with kmap_local_page()") replaced the kmap/kunmap calls in
ext2_get_page/ext2_put_page with kmap_local_page/kunmap_local for
efficiency reasons. As a necessary side change, the commit also
made ext2_get_page (and ext2_find_entry and ext2_dotdot) return
the mapping address along with the page itself, as it is required
for kunmap_local, and converted uses of page_address on such pages
to use the newly returned address instead. However, uses of
page_address on such pages were missed in ext2_check_page and
ext2_delete_entry, which triggers oopses if kmap_local_page happens
to return an address from high memory. Fix this now by converting
the remaining uses of page_address to use the right address, as
returned by kmap_local_page.
Link: https://lore.kernel.org/r/20210714185448.8707ac239e9f12b3a7f5b9f9@urjc.es
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Javier Pello <javier.pello@urjc.es>
Fixes: 782b76d7abdf ("fs/ext2: Replace kmap() with kmap_local_page()")
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/ext2.h')
-rw-r--r-- | fs/ext2/ext2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index b0a694820cb7..e512630cb63e 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -740,7 +740,8 @@ extern int ext2_inode_by_name(struct inode *dir, extern int ext2_make_empty(struct inode *, struct inode *); extern struct ext2_dir_entry_2 *ext2_find_entry(struct inode *, const struct qstr *, struct page **, void **res_page_addr); -extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); +extern int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page, + char *kaddr); extern int ext2_empty_dir (struct inode *); extern struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p, void **pa); extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, void *, |