[6/8] btrfs: Remove needless ASSERT
diff mbox series

Message ID 20200702122335.9117-7-nborisov@suse.com
State New
Headers show
Series
  • Corrupt counter improvement
Related show

Commit Message

Nikolay Borisov July 2, 2020, 12:23 p.m. UTC
compressed_bio::orig_bio is always set in btrfs_submit_compressed_read
before any bio submission is performed. Since that function is always
called with a valid bio it renders the ASSERT unnecessary.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/compression.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Josef Bacik July 2, 2020, 1:19 p.m. UTC | #1
On 7/2/20 8:23 AM, Nikolay Borisov wrote:
> compressed_bio::orig_bio is always set in btrfs_submit_compressed_read
> before any bio submission is performed. Since that function is always
> called with a valid bio it renders the ASSERT unnecessary.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>   fs/btrfs/compression.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index c2d5ca583dbf..db80c3fa6c08 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -244,7 +244,6 @@ static void end_compressed_bio_read(struct bio *bio)
>   	 * Record the correct mirror_num in cb->orig_bio so that
>   	 * read-repair can work properly.
>   	 */
> -	ASSERT(btrfs_io_bio(cb->orig_bio));
>   	btrfs_io_bio(cb->orig_bio)->mirror_num = mirror;
>   	cb->mirror_num = mirror;
>   
> 

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
Johannes Thumshirn July 2, 2020, 1:26 p.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Patch
diff mbox series

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index c2d5ca583dbf..db80c3fa6c08 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -244,7 +244,6 @@  static void end_compressed_bio_read(struct bio *bio)
 	 * Record the correct mirror_num in cb->orig_bio so that
 	 * read-repair can work properly.
 	 */
-	ASSERT(btrfs_io_bio(cb->orig_bio));
 	btrfs_io_bio(cb->orig_bio)->mirror_num = mirror;
 	cb->mirror_num = mirror;