public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: remove dead code in updating backup sb
@ 2022-12-30 14:18 Tanmay Bhushan
  2023-01-02 16:41 ` Jan Kara
  2023-02-19  5:40 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Tanmay Bhushan @ 2022-12-30 14:18 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
  Cc: Tanmay Bhushan

ext4_update_backup_sb checks for err having some value
after unlocking buffer. But err has not been updated
till that point in any code which will lead execution
of the code in question.

Signed-off-by: Tanmay Bhushan <007047221b@gmail.com>
---
 fs/ext4/ioctl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 8067ccda34e4..2e8c34036313 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -155,9 +155,6 @@ static int ext4_update_backup_sb(struct super_block *sb,
 	set_buffer_uptodate(bh);
 	unlock_buffer(bh);
 
-	if (err)
-		goto out_bh;
-
 	if (handle) {
 		err = ext4_handle_dirty_metadata(handle, NULL, bh);
 		if (err)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove dead code in updating backup sb
  2022-12-30 14:18 [PATCH] ext4: remove dead code in updating backup sb Tanmay Bhushan
@ 2023-01-02 16:41 ` Jan Kara
  2023-02-19  5:40 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2023-01-02 16:41 UTC (permalink / raw)
  To: Tanmay Bhushan
  Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel

On Fri 30-12-22 15:18:58, Tanmay Bhushan wrote:
> ext4_update_backup_sb checks for err having some value
> after unlocking buffer. But err has not been updated
> till that point in any code which will lead execution
> of the code in question.
> 
> Signed-off-by: Tanmay Bhushan <007047221b@gmail.com>

Looks good to me. Feel free to add:

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

								Honza

> ---
>  fs/ext4/ioctl.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 8067ccda34e4..2e8c34036313 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -155,9 +155,6 @@ static int ext4_update_backup_sb(struct super_block *sb,
>  	set_buffer_uptodate(bh);
>  	unlock_buffer(bh);
>  
> -	if (err)
> -		goto out_bh;
> -
>  	if (handle) {
>  		err = ext4_handle_dirty_metadata(handle, NULL, bh);
>  		if (err)
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove dead code in updating backup sb
  2022-12-30 14:18 [PATCH] ext4: remove dead code in updating backup sb Tanmay Bhushan
  2023-01-02 16:41 ` Jan Kara
@ 2023-02-19  5:40 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2023-02-19  5:40 UTC (permalink / raw)
  To: linux-ext4, Tanmay Bhushan, Andreas Dilger, linux-kernel
  Cc: Theodore Ts'o

On Fri, 30 Dec 2022 15:18:58 +0100, Tanmay Bhushan wrote:
> ext4_update_backup_sb checks for err having some value
> after unlocking buffer. But err has not been updated
> till that point in any code which will lead execution
> of the code in question.
> 
> 

Applied, thanks!

[1/1] ext4: remove dead code in updating backup sb
      commit: 08abd0466ec9113908e674d042ec2a36dfc2875c

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-19  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-30 14:18 [PATCH] ext4: remove dead code in updating backup sb Tanmay Bhushan
2023-01-02 16:41 ` Jan Kara
2023-02-19  5:40 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox