Re: 2.6.10-rc3-mm1

From: Andrew Morton
Date: Mon Dec 13 2004 - 15:10:14 EST


Rudmer van Dijk <rudmer@xxxxxxxxxxxxxxxxx> wrote:
>
> > OTOH, while I had no problems with the previous mm's or with 2.6.10-rc3,
> > with -rc3-mm1 kdm has an weird function: with kdm/unstable uptodate
> > 4:3.3.1-3 from Debian it just restarts X when it's going to show the
> > login/password form, restarting over and over.
>
> saw it too with gdm on Gentoo,

It's probably the ioctl screwup.


From: Mikael Pettersson <mikpe@xxxxxxxxx>

The ioctl-cleanup.patch in 2.6.10-rc3-mm1 broke the file ioctls: FIONREAD
etc. These ioctls have inline code for S_ISREG() cases, but should be
redirected to ->ioctl() for other cases. ioctl-cleanup.patch removed that
redirection.

For me, both emacs and X refused to start from a console with ENOTTY
errors; at least emacs got the ENOTTY from FIONREAD.

Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

25-akpm/fs/ioctl.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)

diff -puN fs/ioctl.c~ioctl-cleanups-broke-fionread-et-al fs/ioctl.c
--- 25/fs/ioctl.c~ioctl-cleanups-broke-fionread-et-al 2004-12-13 11:12:37.687951760 -0800
+++ 25-akpm/fs/ioctl.c 2004-12-13 11:12:37.690951304 -0800
@@ -91,10 +91,8 @@ asmlinkage long sys_ioctl(unsigned int f
int block;
int res;

- if (!S_ISREG(inode->i_mode)) {
- error = -ENOTTY;
- goto done;
- }
+ if (!S_ISREG(inode->i_mode))
+ break;
/* do we support this mess? */
if (!mapping->a_ops->bmap) {
error = -EINVAL;
@@ -112,19 +110,15 @@ asmlinkage long sys_ioctl(unsigned int f
goto done;
}
case FIGETBSZ:
- if (!S_ISREG(inode->i_mode)) {
- error = -ENOTTY;
- goto done;
- }
+ if (!S_ISREG(inode->i_mode))
+ break;
error = -EBADF;
if (inode->i_sb)
error = put_user(inode->i_sb->s_blocksize, p);
goto done;
case FIONREAD:
- if (!S_ISREG(inode->i_mode)) {
- error = -ENOTTY;
- goto done;
- }
+ if (!S_ISREG(inode->i_mode))
+ break;
error = put_user(i_size_read(inode) - filp->f_pos, p);
goto done;
}
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/