add vma->ops check before do_nonlinear_fault()
Subsystems (2)
PATCH 1/1 add vma->ops check before do_nonlinear_fault()
Function do_nonlinear_fault() will also call vma->vm_ops->fault(). So add vma->ops and vma->vm_ops->fault check the same as before calling do_nonlinear_fault().
--- mm/memory.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
mm/memory.c +7 -3
@@ -2921,9 +2921,13 @@ static inline int handle_pte_fault(struct mm_struct *mm,return do_anonymous_page (mm, vma, address, pte, pmd, flags); } -if (pte_file (entry)) -return do_nonlinear_fault (mm, vma, address, - pte, pmd, flags, entry); +if (pte_file (entry)) { +if (vma->vm_ops) { +if (likely (vma->vm_ops->fault)) +return do_nonlinear_fault (mm, vma, address, + pte, pmd, flags, entry); + } + }return do_swap_page (mm, vma, address, pte, pmd, flags, entry); }
Signature · 7 lines
1.5.6.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Boll Liu
Function
do_nonlinear_fault()will also callvma->vm_ops->fault(). So addvma->opsandvma->vm_ops->faultcheck the same as before callingdo_nonlinear_fault().
I don't think we'd ever install a pte_file entry there for a filesystem that cannot handle it (ie. does not have a ->fault). So I don't think this is needed.
Quoted 29 lines
Signed-off-by Boll Liu <[email protected]>--- mm/memory.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)mm/memory.c +7
-3@@ -2921,9 +2921,13 @@ static inline int handle_pte_fault(struct mm_struct *mm,return do_anonymous_page (mm, vma, address, pte, pmd, flags); } -if (pte_file (entry)) -return do_nonlinear_fault (mm, vma, address, - pte, pmd, flags, entry); +if (pte_file (entry)) { +if (vma->vm_ops) { +if (likely (vma->vm_ops->fault)) +return do_nonlinear_fault (mm, vma, address, + pte, pmd, flags, entry); + } + }return do_swap_page (mm, vma, address, pte, pmd, flags, entry); }Signature · 1 line
1.5.6.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>