Merge tag 'compat-ioctl-fix' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground

Pull compat-ioctl fix from Arnd Bergmann:
"One patch in the compat-ioctl series broke 32-bit rootfs for multiple
people testing on 64-bit kernels. Let's fix it in -rc1 before others
run into the same issue"

* tag 'compat-ioctl-fix' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground:
compat_ioctl: fix FIONREAD on devices

+7 -4
+7 -4
fs/ioctl.c
··· 536 536 537 537 static int file_ioctl(struct file *filp, unsigned int cmd, int __user *p) 538 538 { 539 - struct inode *inode = file_inode(filp); 540 - 541 539 switch (cmd) { 542 540 case FIBMAP: 543 541 return ioctl_fibmap(filp, p); 544 - case FIONREAD: 545 - return put_user(i_size_read(inode) - filp->f_pos, p); 546 542 case FS_IOC_RESVSP: 547 543 case FS_IOC_RESVSP64: 548 544 return ioctl_preallocate(filp, 0, p); ··· 729 733 730 734 case FIDEDUPERANGE: 731 735 return ioctl_file_dedupe_range(filp, argp); 736 + 737 + case FIONREAD: 738 + if (!S_ISREG(inode->i_mode)) 739 + return vfs_ioctl(filp, cmd, arg); 740 + 741 + return put_user(i_size_read(inode) - filp->f_pos, 742 + (int __user *)argp); 732 743 733 744 default: 734 745 if (S_ISREG(inode->i_mode))