lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 2 Sep 2021 19:26:26 +0300
From:   Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To:     Kari Argillander <kari.argillander@...il.com>,
        <ntfs3@...ts.linux.dev>
CC:     <linux-kernel@...r.kernel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH] fs/ntfs3: Remove unnecessary condition checking from
 ntfs_file_read_iter



On 25.08.2021 21:25, Kari Argillander wrote:
> This check will be also performed in generic_file_read_iter() so we do
> not want to check this two times in a row.
> 
> This was founded with Smatch
> 	fs/ntfs3/file.c:803 ntfs_file_read_iter()
> 	warn: unused return: count = iov_iter_count()
> 
> Signed-off-by: Kari Argillander <kari.argillander@...il.com>
> ---
> I cc Dan also because I am happy that I finally managed to install
> Smack and straight away I found something with it. Thank you for
> this great tool.
> 
> Next step is to integrate Smack to CI system. But will probanly take
> a moment.
> ---
>  fs/ntfs3/file.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index cb736701f2cc..5d41b84067ee 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -799,8 +799,6 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
>  
>  static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
>  {
> -	ssize_t err;
> -	size_t count = iov_iter_count(iter);
>  	struct file *file = iocb->ki_filp;
>  	struct inode *inode = file->f_mapping->host;
>  	struct ntfs_inode *ni = ntfs_i(inode);
> @@ -829,9 +827,7 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
>  		return -EOPNOTSUPP;
>  	}
>  
> -	err = count ? generic_file_read_iter(iocb, iter) : 0;
> -
> -	return err;
> +	return generic_file_read_iter(iocb, iter);
>  }
>  
>  /* returns array of locked pages */
> 

Applied, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ