Commit dad4e5b
mm: fix page reference leak in soft_offline_page()
The conversion to move pfn_to_online_page() internal to
soft_offline_page() missed that the get_user_pages() reference taken by
the madvise() path needs to be dropped when pfn_to_online_page() fails.
Note the direct sysfs-path to soft_offline_page() does not perform a
get_user_pages() lookup.
When soft_offline_page() is handed a pfn_valid() && !pfn_to_online_page()
pfn the kernel hangs at dax-device shutdown due to a leaked reference.
Link: https://lkml.kernel.org/r/161058501210.1840162.8108917599181157327.stgit@dwillia2-desk3.amr.corp.intel.com
Fixes: feec24a ("mm, soft-offline: convert parameter to pfn")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Qian Cai <cai@lca.pw>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 251b549 commit dad4e5b
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1885 | 1885 | | |
1886 | 1886 | | |
1887 | 1887 | | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1888 | 1894 | | |
1889 | 1895 | | |
1890 | 1896 | | |
| |||
1910 | 1916 | | |
1911 | 1917 | | |
1912 | 1918 | | |
1913 | | - | |
1914 | 1919 | | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
1915 | 1923 | | |
1916 | 1924 | | |
1917 | 1925 | | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
1918 | 1929 | | |
1919 | 1930 | | |
1920 | | - | |
| 1931 | + | |
| 1932 | + | |
1921 | 1933 | | |
| 1934 | + | |
1922 | 1935 | | |
1923 | 1936 | | |
1924 | 1937 | | |
1925 | | - | |
1926 | | - | |
| 1938 | + | |
1927 | 1939 | | |
1928 | 1940 | | |
1929 | 1941 | | |
| |||
0 commit comments