Mike Kravetz f27a5136f7 hugetlbfs: always use address space in inode for resv_map pointer
Continuing discussion about 58b6e5e8f1ad ("hugetlbfs: fix memory leak for
resv_map") brought up the issue that inode->i_mapping may not point to the
address space embedded within the inode at inode eviction time.  The
hugetlbfs truncate routine handles this by explicitly using inode->i_data.
However, code cleaning up the resv_map will still use the address space
pointed to by inode->i_mapping.  Luckily, private_data is NULL for address
spaces in all such cases today but, there is no guarantee this will
continue.

Change all hugetlbfs code getting a resv_map pointer to explicitly get it
from the address space embedded within the inode.  In addition, add more
comments in the code to indicate why this is being done.

Link: http://lkml.kernel.org/r/20190419204435.16984-1-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reported-by: Yufen Yu <yuyufen@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-14 09:47:50 -07:00
..
2019-05-01 22:43:23 -04:00
2019-05-07 20:51:58 -07:00
2019-05-01 22:43:23 -04:00
2019-05-01 22:43:24 -04:00
2019-05-07 18:14:36 -07:00
2019-05-01 22:43:26 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-07 11:37:27 -07:00
2019-05-01 22:43:25 -04:00
2019-05-09 14:33:15 -07:00
2019-05-09 14:33:15 -07:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:26 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-07 18:14:36 -07:00
2018-10-29 14:29:58 -07:00
2019-05-14 09:47:48 -07:00
2019-03-07 18:32:01 -08:00
2019-04-08 18:21:02 -05:00
2019-03-08 14:48:40 -08:00
2019-05-07 18:14:36 -07:00
2019-01-30 17:44:07 -05:00
2019-04-09 19:20:57 -04:00
2019-04-26 11:09:55 -07:00
2019-04-06 10:48:35 -06:00
2019-02-07 16:38:35 +01:00