From: Lennart Poettering Date: Fri, 8 Feb 2019 16:18:48 +0000 (+0100) Subject: bootspec: stat() on an autofs mount point doesn't trigger it, let's hence do it expli... X-Git-Tag: v242-rc1~218^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8312d69409b467c890ccf17e67ff306fb6fa6925;p=thirdparty%2Fsystemd.git bootspec: stat() on an autofs mount point doesn't trigger it, let's hence do it explicitly --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 2db6425f2f5..53ab0424046 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -874,12 +874,18 @@ static int verify_fsroot_dir( dev_t *ret_dev) { struct stat st, st2; - const char *t2; + const char *t2, *trigger; int r; assert(path); assert(ret_dev); + /* So, the ESP and XBOOTLDR partition are commonly located on an autofs mount. stat() on the + * directory won't trigger it, if it is not mounted yet. Let's hence explicitly trigger it here, + * before stat()ing */ + trigger = strjoina(path, "/trigger"); /* Filename doesn't matter... */ + (void) access(trigger, F_OK); + if (stat(path, &st) < 0) return log_full_errno((searching && errno == ENOENT) || (unprivileged_mode && errno == EACCES) ? LOG_DEBUG : LOG_ERR, errno,