do_vfs_ioctl() answers FIONREAD for regular files with i_size - f_pos before it gets to the file's ->unlocked_ioctl(). The channel files are regular files, so cache_ioctl_procfs() has never seen FIONREAD and only ever failed other commands with -EINVAL. Drop it. Other commands fail with -ENOTTY now.
The rpc_pipefs channel files are regular files as well. Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- net/sunrpc/cache.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 81a3f0068f36..d242b6f33cbc 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1596,15 +1596,6 @@ static __poll_t cache_poll_procfs(struct file *filp, poll_table *wait) return cache_poll(filp, wait, cd); } -static long cache_ioctl_procfs(struct file *filp, - unsigned int cmd, unsigned long arg) -{ - struct inode *inode = file_inode(filp); - struct cache_detail *cd = pde_data(inode); - - return cache_ioctl(inode, filp, cmd, arg, cd); -} - static int cache_open_procfs(struct inode *inode, struct file *filp) { struct cache_detail *cd = pde_data(inode); @@ -1624,7 +1615,6 @@ static const struct proc_ops cache_channel_proc_ops = { .proc_write_buf = cache_write_procfs, .proc_write_size = CACHE_DOWNCALL_MAX, .proc_poll = cache_poll_procfs, - .proc_ioctl = cache_ioctl_procfs, /* for FIONREAD */ .proc_open = cache_open_procfs, .proc_release = cache_release_procfs, }; -- 2.53.0
