rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Gioh Kim <gi-oh.kim@ionos.com>
Cc: rust-for-linux@vger.kernel.org, Gioh Kim <gurugio@gmail.com>,
	Wei Liu <wei.liu@kernel.org>
Subject: Re: [RFC] rust: kernel: ioctl returns ENOTTY if not implemented
Date: Sat, 21 Aug 2021 15:34:49 +0000	[thread overview]
Message-ID: <20210821153449.6kegzubfqnmeyoo6@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20210819204422.64595-1-gi-oh.kim@ionos.com>

On Thu, Aug 19, 2021 at 10:44:22PM +0200, Gioh Kim wrote:
> From: Gioh Kim <gurugio@gmail.com>
> 
> According to fs/ioctl.c, ioctl system call first test the cmd
> value with do_vfs_ioctl. If the cmd is not supported command,
> it calls vfs_ioctl. Then vfs_ioctl returns ENOTTY if ioctl is
> not implemented.
> 
> Signed-off-by: Gioh Kim <gurugio@gmail.com>

FWIW:

Reviewed-by: Wei Liu <wei.liu@kernel.org>

> ---
>  rust/kernel/file_operations.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/file_operations.rs b/rust/kernel/file_operations.rs
> index cad665c0016f..c6f03938de97 100644
> --- a/rust/kernel/file_operations.rs
> +++ b/rust/kernel/file_operations.rs
> @@ -662,7 +662,7 @@ pub trait FileOperations: Send + Sync + Sized {
>          _file: &File,
>          _cmd: &mut IoctlCommand,
>      ) -> Result<i32> {
> -        Err(Error::EINVAL)
> +        Err(Error::ENOTTY)
>      }
>  
>      /// Performs 32-bit IO control operations on that are specific to the file on 64-bit kernels.
> @@ -673,7 +673,7 @@ pub trait FileOperations: Send + Sync + Sized {
>          _file: &File,
>          _cmd: &mut IoctlCommand,
>      ) -> Result<i32> {
> -        Err(Error::EINVAL)
> +        Err(Error::ENOTTY)
>      }
>  
>      /// Syncs pending changes to this file.
> -- 
> 2.25.1
> 

  reply	other threads:[~2021-08-21 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 20:44 [RFC] rust: kernel: ioctl returns ENOTTY if not implemented Gioh Kim
2021-08-21 15:34 ` Wei Liu [this message]
2021-08-23 10:47 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210821153449.6kegzubfqnmeyoo6@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=gi-oh.kim@ionos.com \
    --cc=gurugio@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).