[systemd-devel] [PATCH 2/3] mount: move device links handling from generator

Harald Hoyer harald.hoyer at gmail.com
Mon Aug 26 03:22:29 PDT 2013


On 08/21/2013 03:46 PM, Tom Gundersen wrote:
> On Wed, Aug 21, 2013 at 8:50 PM, Harald Hoyer <harald.hoyer at gmail.com> wrote:
>> On 08/21/2013 01:53 PM, Tom Gundersen wrote:
>>> -                if (!isbind &&
>>> -                    !path_equal(where, "/")) {
>>> -
>>> -                        r = device_name(what, &device);
>>> -                        if (r < 0)
>>> -                                return r;
>>> -
>>> -                        if (r > 0) {
>>> -                                free(lnk);
>>> -                                lnk = strjoin(arg_dest, "/", device, ".wants/", name, NULL);
>>> -                                if (!lnk)
>>> -                                        return log_oom();
>>> -
>>> -                                mkdir_parents_label(lnk, 0755);
>>> -                                if (symlink(unit, lnk) < 0) {
>>> -                                        log_error("Failed to create symlink %s: %m", lnk);
>>> -                                        return -errno;
>>> -                                }
>>> -                        }
>>> -                }
>>
>> Hmm, why is this not needed anymore?
> 
> It is now taken care of by:
> 
> @@ -376,7 +383,11 @@ static int mount_add_device_links(Mount *m) {
>          if (path_equal(m->where, "/"))
>                  return 0;
> 
> -        r = unit_add_node_link(UNIT(m), p->what, false);
> +        if (UNIT(m)->default_dependencies && mount_is_auto(p) &&
> +            UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
> +                device_wants_mount = true;
> +
> +        r = unit_add_node_link(UNIT(m), p->what, device_wants_mount);
>          if (r < 0)
>                  return r;
> 
> Or am I missing something?
> 
> -t
> 


Ah, ok, cool. Just asking. Looks good, if it works as expected.


More information about the systemd-devel mailing list