uprobes: Teach copy_insn() to support tmpfs
authorOleg Nesterov <oleg@redhat.com>
Mon, 19 May 2014 18:41:36 +0000 (20:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 5 Jun 2014 10:30:11 +0000 (12:30 +0200)
commit40814f6805a524130a5ec313871147f7aa9b5318
tree2605a03d0a7360c377126c590cb929e1ed9d0057
parent41ccba029e9492dd0fc1bf5c23b72c6322a6dfe9
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>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140519184136.GB6750@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/uprobes.c