[lkml]   [2020]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v3 13/16] /dev/mem: Only set filp->f_mapping
When we care about pagecache maintenance, we need to make sure that
both f_mapping and i_mapping point at the right mapping.

But for iomem mappings we only care about the virtual/pte side of
things, so f_mapping is enough. Also setting inode->i_mapping was
confusing me as a driver maintainer, since in e.g. drivers/gpu we
don't do that. Per Dan this seems to be copypasta from places which do
care about pagecache consistency, but not needed. Hence remove it for
slightly less confusion.

Signed-off-by: Daniel Vetter <>
Cc: Jason Gunthorpe <>
Cc: Kees Cook <>
Cc: Dan Williams <>
Cc: Andrew Morton <>
Cc: John Hubbard <>
Cc: Jérôme Glisse <>
Cc: Jan Kara <>
Cc: Dan Williams <>
Signed-off-by: Daniel Vetter <>
drivers/char/mem.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index abd4ffdc8cde..5502f56f3655 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -864,7 +864,6 @@ static int open_port(struct inode *inode, struct file *filp)
* revocations when drivers want to take over a /dev/mem mapped
* range.
- inode->i_mapping = devmem_inode->i_mapping;
filp->f_mapping = inode->i_mapping;

return 0;
 \ /
  Last update: 2020-10-21 10:59    [W:0.277 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site