[CRIU] [PATCH 1/1] simplify the "ignore filesystem-subtype" logic

Oleg Nesterov oleg at redhat.com
Fri Apr 10 10:00:16 PDT 2015


On 04/10, Tycho Andersen wrote:
>
> On Fri, Apr 10, 2015 at 06:24:50PM +0200, Oleg Nesterov wrote:
> > We can simply overwrite the dot symbol right after the kernel reports
> > it to us.
>
> I have no objections, although is it possible that we would ever want
> this information? e.g. to pass to a plugin that knows how to unmount a
> specific fuse filesystem?

If we ever need to know the subtype, we need more changes anyway because
this info is lost right after parse_mountinfo() calls parse_mountinfo_ent().

And in this case this part

> > +	/*
> > +	 * The kernel reports "subtypes" sometimes and the valid
> > +	 * type-vs-subtype delimiter is the dot symbol. We disregard
> > +	 * any subtypes for the purpose of finding the fstype.
> > +	 */
> > +	sub = strchr(*fsname, '.');
> > +	if (sub)
> > +		*sub = 0;

can actually help because we can turn this code into

	sub = strchr(*fsname, '.');
	if (sub) {
		*sub++ = '0';
		new->fs_subtype = strdup(sub);
	}

No?


But again, again, I won't argue even if I am right (and I can be easily
wrong). Cleanups are always subjective.

Oleg.



More information about the CRIU mailing list