From: Jan S. <jst...@re...> - 2012-11-01 09:55:46
|
----- Original Message ----- > From: "Wanlong Gao" <gao...@cn...> > To: "Jan Stancek" <jst...@re...> > Cc: "sanil kumar" <san...@hu...>, "Mike Frysinger" <va...@ge...>, "shyju pv" <shy...@hu...>, > "max maxiansheng" <max...@hu...>, "LTP" <ltp...@li...> > Sent: Thursday, 1 November, 2012 9:15:08 AM > Subject: Re: [LTP] [PATCH] ioctl01: change the errno to ENOTTY when passed an invalid command > > >> diff --git a/testcases/kernel/syscalls/ioctl/ioctl01.c > >> b/testcases/kernel/syscalls/ioctl/ioctl01.c > >> index 8b044e7..ef64896 100644 > >> --- a/testcases/kernel/syscalls/ioctl/ioctl01.c > >> +++ b/testcases/kernel/syscalls/ioctl/ioctl01.c > >> @@ -87,7 +87,7 @@ struct test_case_t { > >> &fd, TCGETA, (struct termio *)-1, EFAULT}, > >> /* command is invalid */ > >> { > >> - &fd, INVAL_IOCTL, &termio, EINVAL}, > >> + &fd, INVAL_IOCTL, &termio, ENOTTY}, > > > > Won't this break on older kernels? Can we test for kernel version > > with tst_kvercmp()? > > Surely will, this is also a trouble on my side. > Does we treat this as a kernel bug or a kernel change? > I think if we treat it as a kernel bug, we needn't check the kernel > version, while if > it just a kernel change, we need. > And, What's your opinion about this? I'd go with kernel change, it worked the old way for years, there may be applications which rely on that. If we just change it to 'ENOTTY' it will start failing on older kernels and there are 2 choices: fix the kernel or stop using this testcase. And I'm not sure there are enough arguments to justify changing it in various distro's (stable) kernels. Is this commit backported to any upstream stable trees? Are there plans to do so? Regards, Jan |