hostfs: fix the host directory parse when mounting.
authorHongbo Li <lihongbo22@huawei.com>
Thu, 25 Jul 2024 06:51:30 +0000 (14:51 +0800)
committerChristian Brauner <brauner@kernel.org>
Sat, 27 Jul 2024 07:56:33 +0000 (09:56 +0200)
commitef9ca17ca458ac7253ae71b552e601e49311fc48
tree4d347fb35c049e129d15ff921345da6cd308ff07
parente1c5ae59c0f22f7fe5c07fb5513a29e4aad868c9
hostfs: fix the host directory parse when mounting.

hostfs not keep the host directory when mounting. When the host
directory is none (default), fc->source is used as the host root
directory, and this is wrong. Here we use `parse_monolithic` to
handle the old mount path for parsing the root directory. For new
mount path, The `parse_param` is used for the host directory parse.

Reported-and-tested-by: Maciej Żenczykowski <maze@google.com>
Fixes: cd140ce9f611 ("hostfs: convert hostfs to use the new mount API")
Link: https://lore.kernel.org/all/CANP3RGceNzwdb7w=vPf5=7BCid5HVQDmz1K5kC9JG42+HVAh_g@mail.gmail.com/
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20240725065130.1821964-1-lihongbo22@huawei.com
[brauner: minor fixes]
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/hostfs/hostfs_kern.c