linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] fs/userfaultfd.c: remove a redundant check on end
@ 2019-09-12 21:31 Wei Yang
  2019-09-12 21:31 ` [PATCH 2/3] fs/userfaultfd.c: reorder the if check to reduce some computation Wei Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Wei Yang @ 2019-09-12 21:31 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, Wei Yang

For the ending vma, there is a check to make sure the end is huge page
aligned.

The *if* check makes sure vm_start < end <= vm_end. While the first half
is not necessary, because the *for* clause makes sure vm_start < end.

This patch just removes it.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 fs/userfaultfd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 653d8f7c453c..9ce09ac619a2 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1402,8 +1402,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
 		 * If this vma contains ending address, and huge pages
 		 * check alignment.
 		 */
-		if (is_vm_hugetlb_page(cur) && end <= cur->vm_end &&
-		    end > cur->vm_start) {
+		if (is_vm_hugetlb_page(cur) && end <= cur->vm_end) {
 			unsigned long vma_hpagesize = vma_kernel_pagesize(cur);
 
 			ret = -EINVAL;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-09  1:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 21:31 [PATCH 1/3] fs/userfaultfd.c: remove a redundant check on end Wei Yang
2019-09-12 21:31 ` [PATCH 2/3] fs/userfaultfd.c: reorder the if check to reduce some computation Wei Yang
2019-09-12 21:31 ` [PATCH 3/3] fs/userfaultfd.c: wrap cheching huge page alignment into a helper Wei Yang
2019-10-12  9:16 ` [PATCH 1/3] fs/userfaultfd.c: remove a redundant check on end Wei Yang
2019-11-09  1:29 ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).