erofs: initialize packed inode after root inode is assigned
authorJingbo Xu <jefflexu@linux.alibaba.com>
Fri, 7 Apr 2023 14:17:05 +0000 (22:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:07 +0000 (23:03 +0900)
commit50f1c1fba045d88b6eb24f3dc83eba538519f8a3
treee4b420e09e3115beeaa8e998fde2e5022e36e517
parent7ee7a86e28ce9ead7112286c388df8d254c373c6
erofs: initialize packed inode after root inode is assigned

[ Upstream commit cb9bce79514392a9a216ff67148e05e2d72c28bd ]

As commit 8f7acdae2cd4 ("staging: erofs: kill all failure handling in
fill_super()"), move the initialization of packed inode after root
inode is assigned, so that the iput() in .put_super() is adequate as
the failure handling.

Otherwise, iput() is also needed in .kill_sb(), in case of the mounting
fails halfway.

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Fixes: b15b2e307c3a ("erofs: support on-disk compressed fragments data")
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Acked-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230407141710.113882-3-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/erofs/internal.h
fs/erofs/super.c