[7/7] block: move setting bd_invalidated from flush_disk to check_disk_change
diff mbox series

Message ID 20191114143438.14681-8-hch@lst.de
State New
Headers show
Series
  • [1/7] block: refactor rescan_partitions
Related show

Commit Message

Christoph Hellwig Nov. 14, 2019, 2:34 p.m. UTC
The only other caller of flush_disk instantly clears the flag, so don't
bother setting it there.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hannes Reinecke Nov. 15, 2019, 10:09 a.m. UTC | #1
On 11/14/19 3:34 PM, Christoph Hellwig wrote:
> The only other caller of flush_disk instantly clears the flag, so don't
> bother setting it there.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/block_dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index ee63c2732fa2..f60739b5a24f 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1403,7 +1403,6 @@ static void flush_disk(struct block_device *bdev, bool kill_dirty)
>  		       "resized disk %s\n",
>  		       bdev->bd_disk ? bdev->bd_disk->disk_name : "");
>  	}
> -	bdev->bd_invalidated = 1;
>  }
>  
>  /**
> @@ -1491,6 +1490,7 @@ int check_disk_change(struct block_device *bdev)
>  		return 0;
>  
>  	flush_disk(bdev, true);
> +	bdev->bd_invalidated = 1;
>  	if (bdops->revalidate_disk)
>  		bdops->revalidate_disk(bdev->bd_disk);
>  	return 1;
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes

Patch
diff mbox series

diff --git a/fs/block_dev.c b/fs/block_dev.c
index ee63c2732fa2..f60739b5a24f 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1403,7 +1403,6 @@  static void flush_disk(struct block_device *bdev, bool kill_dirty)
 		       "resized disk %s\n",
 		       bdev->bd_disk ? bdev->bd_disk->disk_name : "");
 	}
-	bdev->bd_invalidated = 1;
 }
 
 /**
@@ -1491,6 +1490,7 @@  int check_disk_change(struct block_device *bdev)
 		return 0;
 
 	flush_disk(bdev, true);
+	bdev->bd_invalidated = 1;
 	if (bdops->revalidate_disk)
 		bdops->revalidate_disk(bdev->bd_disk);
 	return 1;