Re: UML/hostfs - mount failure at tip of tree
From: Christian Brauner
Date: Fri Jul 26 2024 - 03:41:12 EST
On Wed, Jul 24, 2024 at 05:49:16PM GMT, Hongbo Li wrote:
>
>
> On 2024/7/24 11:59, Maciej Żenczykowski wrote:
> > On Tue, Jul 23, 2024 at 7:55 PM Maciej Żenczykowski <maze@xxxxxxxxxx> wrote:
> > >
> > > On Tue, Jul 23, 2024 at 7:22 PM Linus Torvalds
> > > <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > >
> > > > On Tue, 23 Jul 2024 at 18:35, Hongbo Li <lihongbo22@xxxxxxxxxx> wrote:
> > > > >
> > > > > I apologize for causing this issue. I am currently tracking it down. If
> > > > > reverting this can solve the problem, you can revert it first.
> > > >
> > > > I don't get the feeling that this is _so_ urgent that it needs to be
> > > > reverted immediately - let's give it at least a few days and see if
> > > > you (or somebody else) figures out the bug.
> > > >
> > > > Maciej - if you can verify that folio conversion fix suggestion of
> > > > mine (or alternatively report that it doesn't help and I was barking
> > > > up the wrong tree), that would be great.
> > >
> > > That appears to fix the folio patch indeed (ie. I no longer need to revert it).
> > >
> > > The tests are still super unhappy, but I've yet to fix our tests very
> > > broken netlink parser for changes that released in 6.10, so that may
> > > be unrelated ;-)
> >
> > +++ fs/hostfs/hostfs_kern.c:
> > static int hostfs_fill_super(struct super_block *sb, struct fs_context *fc)
> > {
> > struct hostfs_fs_info *fsi = sb->s_fs_info;
> > - const char *host_root = fc->source;
> > + const char *host_root = "/";
> >
> This doesn't work in case where the host directory is designated (such as
> mount -t hostfs hostfs -o /home /host).
>
> I can fix this by the following patch, the root cause of this issue is the
> incorrect parsing of the host directory. The original mount path will use
> `parse_monolithic` to parse the host directory. For the new mount api, it
> use `parse_param` directly. So we should call `fsconfig(fd,
> FSCONFIG_SET_STRING, "hostfs", "xxx", 0)` to mount the hostfs(I think may be
> we should add hostfs as the key for host directory.). This may need
> Christian's reviews.:
I see you sent the patch. I looked at it yesterday but didn't really dig
into it. Let me go do that now. I'll have a pr ready for Linus latest
tomorrow.