[PATCH] erofs: drop unnecessary WARN_ON() in erofs_kill_sb()

Gao Xiang posted 1 patch 2 years, 6 months ago
fs/erofs/super.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] erofs: drop unnecessary WARN_ON() in erofs_kill_sb()
Posted by Gao Xiang 2 years, 6 months ago
Previously, .kill_sb() will be called only after fill_super fails.
It will be changed [1].

Besides, checking for s_magic in erofs_kill_sb() is unnecessary from
any point of view.  Let's get rid of it now.

[1] https://lore.kernel.org/r/20230731-flugbereit-wohnlage-78acdf95ab7e@brauner
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
will upstream this commit later this week after it lands -next.

 fs/erofs/super.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 9d6a3c6158bd..566f68ddfa36 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -889,8 +889,6 @@ static void erofs_kill_sb(struct super_block *sb)
 {
 	struct erofs_sb_info *sbi;
 
-	WARN_ON(sb->s_magic != EROFS_SUPER_MAGIC);
-
 	/* pseudo mount for anon inodes */
 	if (sb->s_flags & SB_KERNMOUNT) {
 		kill_anon_super(sb);
-- 
2.24.4
Re: [PATCH] erofs: drop unnecessary WARN_ON() in erofs_kill_sb()
Posted by Christoph Hellwig 2 years, 6 months ago
On Tue, Aug 01, 2023 at 09:47:37AM +0800, Gao Xiang wrote:
> Previously, .kill_sb() will be called only after fill_super fails.
> It will be changed [1].
> 
> Besides, checking for s_magic in erofs_kill_sb() is unnecessary from
> any point of view.  Let's get rid of it now.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Re: [PATCH] erofs: drop unnecessary WARN_ON() in erofs_kill_sb()
Posted by Christian Brauner 2 years, 6 months ago
On Tue, Aug 01, 2023 at 09:47:37AM +0800, Gao Xiang wrote:
> Previously, .kill_sb() will be called only after fill_super fails.
> It will be changed [1].
> 
> Besides, checking for s_magic in erofs_kill_sb() is unnecessary from
> any point of view.  Let's get rid of it now.
> 
> [1] https://lore.kernel.org/r/20230731-flugbereit-wohnlage-78acdf95ab7e@brauner
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
> will upstream this commit later this week after it lands -next.

Thanks,
Acked-by: Christian Brauner <brauner@kernel.org>