linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fscrypt: remove redundant bi_status check
@ 2019-12-09 20:45 Eric Biggers
  2020-01-03 17:03 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2019-12-09 20:45 UTC (permalink / raw)
  To: linux-fscrypt

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


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

* Re: [PATCH] fscrypt: remove redundant bi_status check
  2019-12-09 20:45 [PATCH] fscrypt: remove redundant bi_status check Eric Biggers
@ 2020-01-03 17:03 ` Eric Biggers
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2020-01-03 17:03 UTC (permalink / raw)
  To: linux-fscrypt

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

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

end of thread, other threads:[~2020-01-03 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 20:45 [PATCH] fscrypt: remove redundant bi_status check Eric Biggers
2020-01-03 17:03 ` Eric Biggers

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).