nommu: fix an incorrect comment in the do_mmap_shared_file()
authorDavid Howells <dhowells@redhat.com>
Tue, 23 Mar 2010 20:35:21 +0000 (13:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Mar 2010 23:31:20 +0000 (16:31 -0700)
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>
mm/nommu.c

index 605ace8982a8dcbc14ac061ab824166a16220180..e4b8f4d28a3f5e9bae983315f77630c21af60a3f 100644 (file)
@@ -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;
 }