From: Hongbo Li <lihongbo22@huawei.com>
To: <kzak@redhat.com>
Cc: <linux-um@lists.infradead.org>, <linux-fsdevel@vger.kernel.org>,
Christian Brauner <brauner@kernel.org>,
Benjamin Berg <benjamin@sipsolutions.net>,
Johannes Berg <johannes@sipsolutions.net>, <rrs@debian.org>
Subject: Re: UML mount failure with Linux 6.11
Date: Mon, 11 Nov 2024 09:16:18 +0800 [thread overview]
Message-ID: <b0acfbdf-339b-4f7b-9fbd-8d864217366b@huawei.com> (raw)
In-Reply-To: <ac1b8ddd62ab22e6311ddba0c07c65b389a1c5df.camel@sipsolutions.net>
Hi Karel,
We are discussing about the hostfs mount with new mount API in [1]. And
may need your help.
After finishing the conversion to the new mount API for hostfs, it
encountered a situation where the old version supported only one mount
option, and the whole mount option was used as the root path (it is also
valid for the path to contain commas). But when switching to the new
mount API, the option part will be split using commas (if I'm not
mistaken, this step would be done in libmount), which could potentially
split a complete path into multiple parts, and the call fsconfig syscall
to set the mount options for underline filesystems. This is different
from the original intention of hostfs. And this kind of situation is not
common in other filesystems.
Is it necessary to handle the hostfs situation specially within libmount.
[1]
https://lore.kernel.org/all/ac1b8ddd62ab22e6311ddba0c07c65b389a1c5df.camel@sipsolutions.net/T/
Thanks,
Hongbo
On 2024/11/7 22:35, Johannes Berg wrote:
> On Thu, 2024-11-07 at 22:17 +0800, Hongbo Li wrote:
>>> There's only one option anyway, so I'd think we just need to fix this
>>> and not require the hostfs= key. Perhaps if and only if it starts with
>>> hostfs= we can treat it as a key, otherwise treat it all as a dir? But I
>>
>> May be we can do that (just record the unknown option in host_root_path
>> when fs_parse failed). But this lead us to consider the case in which we
>> should handle a long option -o unknown1,hostfs=xxx,unknow2, which one
>> should be treated as the root directory? For new mount api, it will call
>> fsconfig three times to set the root directory. For older one, if one
>> path with that name exactly, may be it can mount successfully.
>
> Technically, comma _is_ valid in a dir name, as you say ... so perhaps
> the new mount API handling would need to be modified to have an escape
> for this and not split it automatically, if the underlying FS doesn't
> want that? Or we just revert cd140ce9f611 too?
>
> I feel like perhaps we just found a corner case - clearly the new mount
> API assumes that mount options are always comma-separated, but, well,
> turns out that's simply not true since hostfs has only a single option
> and treats the whole thing as a single string.
>
> johannes
>
next prev parent reply other threads:[~2024-11-11 1:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 8:13 UML mount failure with Linux 6.11 Ritesh Raj Sarraf
2024-10-31 10:07 ` Benjamin Berg
2024-11-06 11:52 ` Ritesh Raj Sarraf
2024-11-06 19:25 ` Benjamin Berg
2024-11-07 6:22 ` Hongbo Li
2024-11-07 13:09 ` Johannes Berg
2024-11-07 14:17 ` Hongbo Li
2024-11-07 14:35 ` Johannes Berg
2024-11-11 1:16 ` Hongbo Li [this message]
2024-11-12 20:10 ` Karel Zak
2024-11-13 1:23 ` Hongbo Li
2024-11-21 13:53 ` Hongbo Li
2024-11-25 17:43 ` Karel Zak
2024-11-26 13:50 ` Johannes Berg
2024-11-27 1:26 ` Hongbo Li
2024-11-27 12:02 ` Karel Zak
2024-11-27 13:15 ` Johannes Berg
2024-11-28 10:58 ` Karel Zak
2024-11-28 12:55 ` Johannes Berg
2024-11-27 13:55 ` Hongbo Li
2024-11-27 11:55 ` Karel Zak
2024-11-27 12:16 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0acfbdf-339b-4f7b-9fbd-8d864217366b@huawei.com \
--to=lihongbo22@huawei.com \
--cc=benjamin@sipsolutions.net \
--cc=brauner@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kzak@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=rrs@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox