[systemd-devel] Incorrect use return value of mount_one in mount_setup_early/mount_setup?

cee1 fykcee1 at gmail.com
Mon Sep 14 18:37:35 PDT 2015


Hi all,

mount_one will return 1 if a mount action is performed; 0 for no mount
performed; and <0 for an error occurred. Right?

In mount_setup, we have the following logic:
"""
for (i = 0; i < ELEMENTSOF(mount_table); i ++) {
        int j;

        j = mount_one(mount_table + i, loaded_policy);

        if (r == 0)
                r = j;

}

if (r < 0)
        return r;
"""

That means the first non-zero return value determines the return value
of mount_setup - If a mount is performed successfully in
mount_one(which set r to 1), an error in next call of mount_one will
*NOT* be detected(since r == 1). Is this the expected behavior?



-- 
Regards,

- cee1


More information about the systemd-devel mailing list