Skip to content

Commit

Permalink
nommu: fix an incorrect comment in the do_mmap_shared_file()
Browse files Browse the repository at this point in the history
Fix an incorrect comment in the do_mmap_shared_file().  If a mapping is
requested MAP_SHARED, then a private copy cannot be made and still provide
correct semantics.

Signed-off-by: David Howells <dhowells@redhat.com>
Reported-by: Dave Hudson <uclinux@blueteddy.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Mar 24, 2010
1 parent 28b8e8d commit 3fa3046
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,10 +1040,9 @@ static int do_mmap_shared_file(struct vm_area_struct *vma)
if (ret != -ENOSYS)
return ret;

/* getting an ENOSYS error indicates that direct mmap isn't
* possible (as opposed to tried but failed) so we'll fall
* through to making a private copy of the data and mapping
* that if we can */
/* getting -ENOSYS indicates that direct mmap isn't possible (as
* opposed to tried but failed) so we can only give a suitable error as
* it's not possible to make a private copy if MAP_SHARED was given */
return -ENODEV;
}

Expand Down

0 comments on commit 3fa3046

Please sign in to comment.