uprobes: Teach copy_insn() to support tmpfs
authorOleg Nesterov <oleg@redhat.com>
Mon, 19 May 2014 14:13:34 +0000 (16:13 +0200)
committerOleg Nesterov <oleg@redhat.com>
Mon, 2 Jun 2014 13:54:46 +0000 (15:54 +0200)
commit45e0a79a82d31ddfa4c7c1dd9751ca48406f2fa4
tree5dd0c6253beeac1413b9ac38378ef3a48cba30a3
parent7fa3134817d3cc813aeba9acc7e284f2f535f1f5
uprobes: Teach copy_insn() to support tmpfs

tmpfs is widely used but as Denys reports shmem_aops doesn't have
->readpage() and thus you can't probe a binary on this filesystem.

As Hugh suggested we can use shmem_read_mapping_page() in this case,
just we need to check shmem_mapping() if ->readpage == NULL.

Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
Suggested-by: Hugh Dickins <hughd@google.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
kernel/events/uprobes.c