linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Usage of get_user_pages() in fs/aio.c
@ 2002-11-06 20:15 Ingo Oeser
  2002-11-07 19:46 ` Benjamin LaHaise
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Oeser @ 2002-11-06 20:15 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: linux-mm

Hi Ben,

in kernel 2.5.46 in file fs/aio.c line 150 you use
get_user_pages() in a way that makes no sense to me.

Your call is:

info->nr_pages = get_user_pages(current, ctx->mm,
                                  info->mmap_base, info->mmap_size, 
                                  1, 0, info->ring_pages, NULL);

info->mmap_size contains the number of BYTES mapped by the pages
in the ring_pages ARRAY.

get_user_pages() expects the number of ELEMENTS in the array
instead.

What this can cause is clear ;-)

Simple fix would be to replace "info->mmap_size" with "nr_pages",
that you compute just some lines above.

Please tell me, if I'm wrong here.

Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

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

end of thread, other threads:[~2002-11-07 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 20:15 Usage of get_user_pages() in fs/aio.c Ingo Oeser
2002-11-07 19:46 ` Benjamin LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox