X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=mm%2Fmadvise.c;h=56324a3dbc4e98f9cf1283901c95617b03087b4e;hb=aa99f3c2b9c797d8fee28c674a2cbb5adb2ce2ef;hp=6d3d348b17f47d15e3880eecbcc6f52f2798ec44;hpb=877029d9216dcc842f50d37571f318cd17a30a2d;p=linux-2.6-microblaze.git diff --git a/mm/madvise.c b/mm/madvise.c index 6d3d348b17f4..56324a3dbc4e 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -862,10 +862,12 @@ static long madvise_populate(struct vm_area_struct *vma, switch (pages) { case -EINTR: return -EINTR; - case -EFAULT: /* Incompatible mappings / permissions. */ + case -EINVAL: /* Incompatible mappings / permissions. */ return -EINVAL; case -EHWPOISON: return -EHWPOISON; + case -EFAULT: /* VM_FAULT_SIGBUS or VM_FAULT_SIGSEGV */ + return -EFAULT; default: pr_warn_once("%s: unhandled return value: %ld\n", __func__, pages); @@ -910,7 +912,7 @@ static long madvise_remove(struct vm_area_struct *vma, + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); /* - * Filesystem's fallocate may need to take i_mutex. We need to + * Filesystem's fallocate may need to take i_rwsem. We need to * explicitly grab a reference because the vma (and hence the * vma's reference to the file) can go away as soon as we drop * mmap_lock.