Commit f33ea7f
[PATCH] fix get_user_pages bug
Checking pte_dirty instead of pte_write in __follow_page is problematic
for s390, and for copy_one_pte which leaves dirty when clearing write.
So revert __follow_page to check pte_write as before, and make
do_wp_page pass back a special extra VM_FAULT_WRITE bit to say it has
done its full job: once get_user_pages receives this value, it no longer
requires pte_write in __follow_page.
But most callers of handle_mm_fault, in the various architectures, have
switch statements which do not expect this new case. To avoid changing
them all in a hurry, make an inline wrapper function (using the old
name) that masks off the new bit, and use the extended interface with
double underscores.
Yes, we do have a call to do_wp_page from do_swap_page, but no need to
change that: in rare case it's needed, another do_wp_page will follow.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
[ Cleanups by Nick Piggin ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>1 parent 5cb4cc0 commit f33ea7f
2 files changed
Lines changed: 40 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
632 | 638 | | |
633 | 639 | | |
634 | 640 | | |
| |||
704 | 710 | | |
705 | 711 | | |
706 | 712 | | |
707 | | - | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
708 | 720 | | |
709 | 721 | | |
710 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
| 814 | + | |
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
822 | 824 | | |
| 825 | + | |
823 | 826 | | |
824 | 827 | | |
825 | 828 | | |
| |||
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
| 947 | + | |
944 | 948 | | |
945 | 949 | | |
946 | 950 | | |
947 | | - | |
| 951 | + | |
948 | 952 | | |
949 | 953 | | |
950 | 954 | | |
| |||
957 | 961 | | |
958 | 962 | | |
959 | 963 | | |
960 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
961 | 974 | | |
962 | 975 | | |
963 | 976 | | |
| |||
1220 | 1233 | | |
1221 | 1234 | | |
1222 | 1235 | | |
| 1236 | + | |
1223 | 1237 | | |
1224 | 1238 | | |
1225 | 1239 | | |
| |||
1247 | 1261 | | |
1248 | 1262 | | |
1249 | 1263 | | |
1250 | | - | |
| 1264 | + | |
1251 | 1265 | | |
1252 | 1266 | | |
1253 | 1267 | | |
| |||
1274 | 1288 | | |
1275 | 1289 | | |
1276 | 1290 | | |
| 1291 | + | |
1277 | 1292 | | |
1278 | 1293 | | |
1279 | 1294 | | |
| |||
1290 | 1305 | | |
1291 | 1306 | | |
1292 | 1307 | | |
| 1308 | + | |
1293 | 1309 | | |
1294 | 1310 | | |
1295 | 1311 | | |
1296 | 1312 | | |
1297 | 1313 | | |
1298 | | - | |
| 1314 | + | |
1299 | 1315 | | |
1300 | 1316 | | |
1301 | 1317 | | |
| |||
1987 | 2003 | | |
1988 | 2004 | | |
1989 | 2005 | | |
1990 | | - | |
1991 | 2006 | | |
1992 | 2007 | | |
1993 | 2008 | | |
| |||
2002 | 2017 | | |
2003 | 2018 | | |
2004 | 2019 | | |
2005 | | - | |
| 2020 | + | |
2006 | 2021 | | |
2007 | 2022 | | |
2008 | 2023 | | |
| |||
0 commit comments