[systemd-devel] [PATCH] mount: Don't add conflicts with umount.target for certain mounts

Lennart Poettering lennart at poettering.net
Mon Jun 17 12:16:28 PDT 2013


On Thu, 13.06.13 08:46, Ross Lagerwall (rosslagerwall at gmail.com) wrote:

> -                r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true);
> -                if (r < 0)
> -                        goto fail;
> +                if (!path_equal(where, "/") && !path_equal(where, "/usr") &&
> +                    !mount_test_option(options, "x-initrd.mount")) {
> +                        r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true);
> +                        if (r < 0)
> +                                goto fail;
> +                }

Hmm "x-initrd.mount" will never show up in the "options" variable, since
that's from the kernel, and the kernel doesn't know that option, that's
purely a userspace option.

For now I have commited a simpler patch which only checks for /, which
also mimics what fstab-generator currently does.

(In the long run we really should figure out which deps fstab-genrator
generates and which are implicitly added in by mount.c. Currently,
there's no clear structure in there, and quite a bit of duplication.)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list