fscrypt: remove redundant bi_status check
diff mbox series

Message ID 20191209204509.228942-1-ebiggers@kernel.org
State Accepted
Headers show
Series
  • fscrypt: remove redundant bi_status check
Related show

Commit Message

Eric Biggers Dec. 9, 2019, 8:45 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

submit_bio_wait() already returns bi_status translated to an errno.
So the additional check of bi_status is redundant and can be removed.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/crypto/bio.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Eric Biggers Jan. 3, 2020, 5:03 p.m. UTC | #1
On Mon, Dec 09, 2019 at 12:45:09PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> submit_bio_wait() already returns bi_status translated to an errno.
> So the additional check of bi_status is redundant and can be removed.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  fs/crypto/bio.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c
> index 1f4b8a2770606..b88d417e186e5 100644
> --- a/fs/crypto/bio.c
> +++ b/fs/crypto/bio.c
> @@ -77,8 +77,6 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
>  			goto errout;
>  		}
>  		err = submit_bio_wait(bio);
> -		if (err == 0 && bio->bi_status)
> -			err = -EIO;
>  		bio_put(bio);
>  		if (err)
>  			goto errout;
> -- 
> 2.24.0.393.g34dc348eaf-goog
> 

Applied to fscrypt.git#master for 5.6.

- Eric

Patch
diff mbox series

diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c
index 1f4b8a2770606..b88d417e186e5 100644
--- a/fs/crypto/bio.c
+++ b/fs/crypto/bio.c
@@ -77,8 +77,6 @@  int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
 			goto errout;
 		}
 		err = submit_bio_wait(bio);
-		if (err == 0 && bio->bi_status)
-			err = -EIO;
 		bio_put(bio);
 		if (err)
 			goto errout;