diff -up autofs-5.0.3/daemon/direct.c.expire-works-too-hard autofs-5.0.3/daemon/direct.c --- autofs-5.0.3/daemon/direct.c.expire-works-too-hard 2008-01-14 13:39:16.000000000 +0900 +++ autofs-5.0.3/daemon/direct.c 2008-02-25 08:48:08.000000000 +0900 @@ -808,7 +808,7 @@ static int expire_direct(int ioctlfd, co if (fstat(ioctlfd, &st) == -1) { char *estr = strerror_r(errno, buf, MAX_ERR_BUF); - error(logopt, "fstat failed: %s", estr); + debug(logopt, "fstat failed: %s", estr); return 0; } @@ -824,11 +824,16 @@ static int expire_direct(int ioctlfd, co if (errno == EBADF || errno == EINVAL) return 1; - /* Other than need to wait for the kernel ? */ - if (errno != EAGAIN) - return 0; + /* + * Other than EAGAIN is an expire error so continue. + * Kernel try the same mount again, limited by + * retries (ie. number of mounts directly under + * mount point, should always be one for direct + * mounts). + */ + if (errno == EAGAIN) + break; } - nanosleep(&tm, NULL); } diff -up autofs-5.0.3/daemon/indirect.c.expire-works-too-hard autofs-5.0.3/daemon/indirect.c --- autofs-5.0.3/daemon/indirect.c.expire-works-too-hard 2008-01-14 13:39:16.000000000 +0900 +++ autofs-5.0.3/daemon/indirect.c 2008-02-25 08:48:53.000000000 +0900 @@ -328,7 +328,7 @@ static int expire_indirect(struct autofs if (fstat(ioctlfd, &st) == -1) { char *estr = strerror_r(errno, buf, MAX_ERR_BUF); - error(ap->logopt, "fstat failed: %s", estr); + debug(ap->logopt, "fstat failed: %s", estr); return 0; } @@ -344,11 +344,13 @@ static int expire_indirect(struct autofs if (errno == EBADF || errno == EINVAL) return 1; - /* Other than need to wait for the kernel ? */ - if (errno != EAGAIN) - return 0; + /* + * Other than EAGAIN is an expire error so continue. + * Kernel will try the next mount. + */ + if (errno == EAGAIN) + break; } - nanosleep(&tm, NULL); } diff -up autofs-5.0.3/CHANGELOG.expire-works-too-hard autofs-5.0.3/CHANGELOG --- autofs-5.0.3/CHANGELOG.expire-works-too-hard 2008-02-25 08:44:54.000000000 +0900 +++ autofs-5.0.3/CHANGELOG 2008-02-25 08:48:08.000000000 +0900 @@ -6,6 +6,7 @@ - avoid using UDP for probing NFSv4 mount requests. - use libldap instead of libldap_r (Guillaume Rousse). - another fix for don't fail on empty master map. +- fix expire working harder than needed. 14/01/2008 autofs-5.0.3 -----------------------