diff mbox series

[4/5] mm: don't automatically unregister bdis

Message ID 20211021124441.668816-5-hch@lst.de
State Not Applicable
Headers show
Series [1/5] mm: export bdi_unregister | expand

Commit Message

Christoph Hellwig Oct. 21, 2021, 12:44 p.m. UTC
All BDI users now unregister explicitly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 mm/backing-dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jan Kara Oct. 22, 2021, 8:51 a.m. UTC | #1
On Thu 21-10-21 14:44:40, Christoph Hellwig wrote:
> All BDI users now unregister explicitly.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good. Feel free to add:

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

								Honza

> ---
>  mm/backing-dev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 8a46a0a4b72fa..768e9ae489f66 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -965,8 +965,7 @@ static void release_bdi(struct kref *ref)
>  	struct backing_dev_info *bdi =
>  			container_of(ref, struct backing_dev_info, refcnt);
>  
> -	if (test_bit(WB_registered, &bdi->wb.state))
> -		bdi_unregister(bdi);
> +	WARN_ON_ONCE(test_bit(WB_registered, &bdi->wb.state));
>  	WARN_ON_ONCE(bdi->dev);
>  	wb_exit(&bdi->wb);
>  	kfree(bdi);
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 8a46a0a4b72fa..768e9ae489f66 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -965,8 +965,7 @@  static void release_bdi(struct kref *ref)
 	struct backing_dev_info *bdi =
 			container_of(ref, struct backing_dev_info, refcnt);
 
-	if (test_bit(WB_registered, &bdi->wb.state))
-		bdi_unregister(bdi);
+	WARN_ON_ONCE(test_bit(WB_registered, &bdi->wb.state));
 	WARN_ON_ONCE(bdi->dev);
 	wb_exit(&bdi->wb);
 	kfree(bdi);