@@ -78,12 +78,6 @@ static int bad_inode_rename2(struct inode *old_dir, struct dentry *old_dentry,
return -EIO;
}
-static int bad_inode_readlink(struct dentry *dentry, char __user *buffer,
- int buflen)
-{
- return -EIO;
-}
-
static int bad_inode_permission(struct inode *inode, int mask)
{
return -EIO;
@@ -178,7 +172,7 @@ static const struct inode_operations bad_inode_ops =
.rmdir = bad_inode_rmdir,
.mknod = bad_inode_mknod,
.rename2 = bad_inode_rename2,
- .readlink = bad_inode_readlink,
+ .readlink = generic_readlink,
.permission = bad_inode_permission,
.getattr = bad_inode_getattr,
.setattr = bad_inode_setattr,
This will allow us to move the generic readlink logic into the VFS and get rid of the readlink method. If inode has i_link set then this patch changes behavior, because generic_readlink will return the cached contents instead of calling i_op->get_link. It would be hard to imagine that this change could break userspace in any sane setup, though. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> --- fs/bad_inode.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)