|
@@ -536,9 +536,6 @@ static int __copy_insn(struct address_space *mapping, struct file *filp,
|
|
|
void *insn, int nbytes, loff_t offset)
|
|
|
{
|
|
|
struct page *page;
|
|
|
-
|
|
|
- if (!mapping->a_ops->readpage)
|
|
|
- return -EIO;
|
|
|
/*
|
|
|
* Ensure that the page that has the original instruction is
|
|
|
* populated and in page-cache.
|
|
@@ -879,6 +876,9 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *
|
|
|
if (!uc->handler && !uc->ret_handler)
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ /* copy_insn()->read_mapping_page() needs ->readpage() */
|
|
|
+ if (!inode->i_mapping->a_ops->readpage)
|
|
|
+ return -EIO;
|
|
|
/* Racy, just to catch the obvious mistakes */
|
|
|
if (offset > i_size_read(inode))
|
|
|
return -EINVAL;
|