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] [thread-next>] [day] [month] [year] [list]
Message-ID: <nheimrse4p6rdmvtrx7hxuvvn4th6tfjn2ga36vaht3xypfyce@r4dwfe2uahbg>
Date: Fri, 3 Jan 2025 15:39:00 +0100
From: Jan Kara <jack@...e.cz>
To: Kemeng Shi <shikemeng@...weicloud.com>
Cc: tytso@....edu, jack@...e.com, linux-ext4@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] jbd2: remove unused return value of do_readahead

On Wed 25-12-24 04:27:04, Kemeng Shi wrote:
> Remove unused return value of do_readahead.
> 
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>

Yeah, we are unlikely to act on errors from readahead. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/jbd2/recovery.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index 9192be7c19d8..a671f8ee7dd2 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -65,9 +65,8 @@ static void journal_brelse_array(struct buffer_head *b[], int n)
>   */
>  
>  #define MAXBUF 8
> -static int do_readahead(journal_t *journal, unsigned int start)
> +static void do_readahead(journal_t *journal, unsigned int start)
>  {
> -	int err;
>  	unsigned int max, nbufs, next;
>  	unsigned long long blocknr;
>  	struct buffer_head *bh;
> @@ -85,7 +84,7 @@ static int do_readahead(journal_t *journal, unsigned int start)
>  	nbufs = 0;
>  
>  	for (next = start; next < max; next++) {
> -		err = jbd2_journal_bmap(journal, next, &blocknr);
> +		int err = jbd2_journal_bmap(journal, next, &blocknr);
>  
>  		if (err) {
>  			printk(KERN_ERR "JBD2: bad block at offset %u\n",
> @@ -94,10 +93,8 @@ static int do_readahead(journal_t *journal, unsigned int start)
>  		}
>  
>  		bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
> -		if (!bh) {
> -			err = -ENOMEM;
> +		if (!bh)
>  			goto failed;
> -		}
>  
>  		if (!buffer_uptodate(bh) && !buffer_locked(bh)) {
>  			bufs[nbufs++] = bh;
> @@ -112,12 +109,10 @@ static int do_readahead(journal_t *journal, unsigned int start)
>  
>  	if (nbufs)
>  		bh_readahead_batch(nbufs, bufs, 0);
> -	err = 0;
>  
>  failed:
>  	if (nbufs)
>  		journal_brelse_array(bufs, nbufs);
> -	return err;
>  }
>  
>  #endif /* __KERNEL__ */
> -- 
> 2.30.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ