|
@@ -830,7 +830,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
|
|
|
|
|
|
/* check not compatible vmas */
|
|
|
ret = -EINVAL;
|
|
|
- if (cur->vm_ops)
|
|
|
+ if (!vma_is_anonymous(cur))
|
|
|
goto out_unlock;
|
|
|
|
|
|
/*
|
|
@@ -855,7 +855,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
|
|
|
do {
|
|
|
cond_resched();
|
|
|
|
|
|
- BUG_ON(vma->vm_ops);
|
|
|
+ BUG_ON(!vma_is_anonymous(vma));
|
|
|
BUG_ON(vma->vm_userfaultfd_ctx.ctx &&
|
|
|
vma->vm_userfaultfd_ctx.ctx != ctx);
|
|
|
|
|
@@ -981,7 +981,7 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
|
|
|
* provides for more strict behavior to notice
|
|
|
* unregistration errors.
|
|
|
*/
|
|
|
- if (cur->vm_ops)
|
|
|
+ if (!vma_is_anonymous(cur))
|
|
|
goto out_unlock;
|
|
|
|
|
|
found = true;
|
|
@@ -995,7 +995,7 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
|
|
|
do {
|
|
|
cond_resched();
|
|
|
|
|
|
- BUG_ON(vma->vm_ops);
|
|
|
+ BUG_ON(!vma_is_anonymous(vma));
|
|
|
|
|
|
/*
|
|
|
* Nothing to do: this vma is already registered into this
|