File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,11 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
153
153
if (pvmw -> pmd && !pvmw -> pte )
154
154
return not_found (pvmw );
155
155
156
- if (pvmw -> pte )
157
- goto next_pte ;
158
-
159
156
if (unlikely (PageHuge (page ))) {
157
+ /* The only possible mapping was handled on last iteration */
158
+ if (pvmw -> pte )
159
+ return not_found (pvmw );
160
+
160
161
/* when pud is not present, pte will be NULL */
161
162
pvmw -> pte = huge_pte_offset (mm , pvmw -> address , page_size (page ));
162
163
if (!pvmw -> pte )
@@ -168,6 +169,9 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
168
169
return not_found (pvmw );
169
170
return true;
170
171
}
172
+
173
+ if (pvmw -> pte )
174
+ goto next_pte ;
171
175
restart :
172
176
pgd = pgd_offset (mm , pvmw -> address );
173
177
if (!pgd_present (* pgd ))
@@ -233,7 +237,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
233
237
return true;
234
238
next_pte :
235
239
/* Seek to next pte only makes sense for THP */
236
- if (!PageTransHuge (page ) || PageHuge ( page ) )
240
+ if (!PageTransHuge (page ))
237
241
return not_found (pvmw );
238
242
end = vma_address_end (page , pvmw -> vma );
239
243
do {
You can’t perform that action at this time.
0 commit comments