* [PATCH nfs-utils] nfs-server-generator: avoid using external services.
@ 2016-10-13 6:50 NeilBrown
2016-11-01 18:45 ` Steve Dickson
0 siblings, 1 reply; 6+ messages in thread
From: NeilBrown @ 2016-10-13 6:50 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing List
[-- Attachment #1: Type: text/plain, Size: 2917 bytes --]
nfs-server-generator is run very early when a lot of services
are not yet started, so it mustn't depend on them.
Currently it can try to use hostname lookup and syslog.
Hostname-lookup is not needed, as we don't use the host issue,
and sending message to stderr is sufficient for the generator.
Disabling syslog is easy - call a function that sets a static variable.
Disabling hostname lookup isn't quite so easy, so add a static variable
which can be set to disable it.
Signed-off-by: NeilBrown <neilb@suse.com>
---
hi,
I contemplated passing another arg to export_read() and export_d_read()
to resolve this, but it didn't seem worth it.
Is this approach OK to people?
Thanks,
NeilBrown
support/export/export.c | 12 ++++++++++--
support/include/exportfs.h | 1 +
systemd/nfs-server-generator.c | 4 ++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/support/export/export.c b/support/export/export.c
index 0b8a858c2c74..c65dc8807a4e 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -67,6 +67,14 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
}
}
+static int assume_canonical = 0;
+
+void
+export_avoid_host_lookup(int i)
+{
+ assume_canonical = i;
+}
+
/**
* export_read - read entries from /etc/exports
* @fname: name of file to read from
@@ -83,9 +91,9 @@ export_read(char *fname)
setexportent(fname, "r");
while ((eep = getexportent(0,1)) != NULL) {
- exp = export_lookup(eep->e_hostname, eep->e_path, 0);
+ exp = export_lookup(eep->e_hostname, eep->e_path, assume_canonical);
if (!exp) {
- if (export_create(eep, 0))
+ if (export_create(eep, assume_canonical))
/* possible complaints already logged */
volumes++;
}
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index f033329b5fd2..ba45b2dee199 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -134,6 +134,7 @@ struct addrinfo * client_resolve(const struct sockaddr *sap);
int client_member(const char *client,
const char *name);
+void export_avoid_host_lookup(int i);
int export_read(char *fname);
int export_d_read(const char *dname);
void export_reset(nfs_export *);
diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
index af8bb52bfbd7..7ae6dd1c4b20 100644
--- a/systemd/nfs-server-generator.c
+++ b/systemd/nfs-server-generator.c
@@ -93,6 +93,10 @@ int main(int argc, char *argv[])
FILE *f, *fstab;
struct mntent *mnt;
+ /* Avoid using any external services */
+ xlog_syslog(0);
+ export_avoid_host_lookup(1);
+
if (argc != 4 || argv[1][0] != '/') {
fprintf(stderr, "nfs-server-generator: create systemd dependencies for nfs-server\n");
fprintf(stderr, "Usage: normal-dir early-dir late-dir\n");
--
2.10.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH nfs-utils] nfs-server-generator: avoid using external services.
2016-10-13 6:50 [PATCH nfs-utils] nfs-server-generator: avoid using external services NeilBrown
@ 2016-11-01 18:45 ` Steve Dickson
2016-11-01 19:55 ` NeilBrown
0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2016-11-01 18:45 UTC (permalink / raw)
To: NeilBrown; +Cc: Linux NFS Mailing List
Hello,
On 10/13/2016 02:50 AM, NeilBrown wrote:
>
> nfs-server-generator is run very early when a lot of services
> are not yet started, so it mustn't depend on them.
> Currently it can try to use hostname lookup and syslog.
>
> Hostname-lookup is not needed, as we don't use the host issue,
> and sending message to stderr is sufficient for the generator.
>
> Disabling syslog is easy - call a function that sets a static variable.
>
> Disabling hostname lookup isn't quite so easy, so add a static variable
> which can be set to disable it.
>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>
> hi,
> I contemplated passing another arg to export_read() and export_d_read()
> to resolve this, but it didn't seem worth it.
>
> Is this approach OK to people?
It's not the most eloquent interface I've
ever seen... ;-)
What are the failures this is fixing? When a
hostname lookup is done what happens? Failure
hangs stopping the server from coming up?
>
> Thanks,
> NeilBrown
>
>
> support/export/export.c | 12 ++++++++++--
> support/include/exportfs.h | 1 +
> systemd/nfs-server-generator.c | 4 ++++
> 3 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/support/export/export.c b/support/export/export.c
> index 0b8a858c2c74..c65dc8807a4e 100644
> --- a/support/export/export.c
> +++ b/support/export/export.c
> @@ -67,6 +67,14 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
> }
> }
If we do have to stay with this approach,
I definitely think comment explaining
why its needed and what it does.
Finally, on an unrelated issue I'm seeing
SELinux preventing nfs-server-generator from
accessing nfs-server.service.d/order-with-mounts.conf
because of a labeling issue. I guess the label
should be nfsd_unit_file_t not systemd_unit_file_t
steved.
>
> +static int assume_canonical = 0;
> +
> +void
> +export_avoid_host_lookup(int i)
> +{
> + assume_canonical = i;
> +}
> +
> /**
> * export_read - read entries from /etc/exports
> * @fname: name of file to read from
> @@ -83,9 +91,9 @@ export_read(char *fname)
>
> setexportent(fname, "r");
> while ((eep = getexportent(0,1)) != NULL) {
> - exp = export_lookup(eep->e_hostname, eep->e_path, 0);
> + exp = export_lookup(eep->e_hostname, eep->e_path, assume_canonical);
> if (!exp) {
> - if (export_create(eep, 0))
> + if (export_create(eep, assume_canonical))
> /* possible complaints already logged */
> volumes++;
> }
> diff --git a/support/include/exportfs.h b/support/include/exportfs.h
> index f033329b5fd2..ba45b2dee199 100644
> --- a/support/include/exportfs.h
> +++ b/support/include/exportfs.h
> @@ -134,6 +134,7 @@ struct addrinfo * client_resolve(const struct sockaddr *sap);
> int client_member(const char *client,
> const char *name);
>
> +void export_avoid_host_lookup(int i);
> int export_read(char *fname);
> int export_d_read(const char *dname);
> void export_reset(nfs_export *);
> diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
> index af8bb52bfbd7..7ae6dd1c4b20 100644
> --- a/systemd/nfs-server-generator.c
> +++ b/systemd/nfs-server-generator.c
> @@ -93,6 +93,10 @@ int main(int argc, char *argv[])
> FILE *f, *fstab;
> struct mntent *mnt;
>
> + /* Avoid using any external services */
> + xlog_syslog(0);
> + export_avoid_host_lookup(1);
> +
> if (argc != 4 || argv[1][0] != '/') {
> fprintf(stderr, "nfs-server-generator: create systemd dependencies for nfs-server\n");
> fprintf(stderr, "Usage: normal-dir early-dir late-dir\n");
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH nfs-utils] nfs-server-generator: avoid using external services.
2016-11-01 18:45 ` Steve Dickson
@ 2016-11-01 19:55 ` NeilBrown
2016-11-01 22:03 ` Steve Dickson
0 siblings, 1 reply; 6+ messages in thread
From: NeilBrown @ 2016-11-01 19:55 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing List
[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]
On Wed, Nov 02 2016, Steve Dickson wrote:
> Hello,
>
> On 10/13/2016 02:50 AM, NeilBrown wrote:
>>
>> nfs-server-generator is run very early when a lot of services
>> are not yet started, so it mustn't depend on them.
>> Currently it can try to use hostname lookup and syslog.
>>
>> Hostname-lookup is not needed, as we don't use the host issue,
>> and sending message to stderr is sufficient for the generator.
>>
>> Disabling syslog is easy - call a function that sets a static variable.
>>
>> Disabling hostname lookup isn't quite so easy, so add a static variable
>> which can be set to disable it.
>>
>> Signed-off-by: NeilBrown <neilb@suse.com>
>> ---
>>
>> hi,
>> I contemplated passing another arg to export_read() and export_d_read()
>> to resolve this, but it didn't seem worth it.
>>
>> Is this approach OK to people?
> It's not the most eloquent interface I've
> ever seen... ;-)
>
> What are the failures this is fixing? When a
> hostname lookup is done what happens? Failure
> hangs stopping the server from coming up?
I never actually reproduced it myself, but I think that when hostname
lookup failed (possibly after a timeout) it tried to log an error via
syslog and writing to syslog blocked indefinitely.
The systemd.generator manpage explicitly rules out trying to talk to
syslog.
>
>
>>
>> Thanks,
>> NeilBrown
>>
>>
>> support/export/export.c | 12 ++++++++++--
>> support/include/exportfs.h | 1 +
>> systemd/nfs-server-generator.c | 4 ++++
>> 3 files changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/support/export/export.c b/support/export/export.c
>> index 0b8a858c2c74..c65dc8807a4e 100644
>> --- a/support/export/export.c
>> +++ b/support/export/export.c
>> @@ -67,6 +67,14 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
>> }
>> }
> If we do have to stay with this approach,
> I definitely think comment explaining
> why its needed and what it does.
That's sensible. I'll resend with some nice friendly comments.
>
> Finally, on an unrelated issue I'm seeing
> SELinux preventing nfs-server-generator from
> accessing nfs-server.service.d/order-with-mounts.conf
> because of a labeling issue. I guess the label
> should be nfsd_unit_file_t not systemd_unit_file_t
I wouldn't know about that :-(
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH nfs-utils] nfs-server-generator: avoid using external services.
2016-11-01 19:55 ` NeilBrown
@ 2016-11-01 22:03 ` Steve Dickson
2016-11-02 0:25 ` [PATCH nfs-utils v2] " NeilBrown
0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2016-11-01 22:03 UTC (permalink / raw)
To: NeilBrown; +Cc: Linux NFS Mailing List
On 11/01/2016 03:55 PM, NeilBrown wrote:
> On Wed, Nov 02 2016, Steve Dickson wrote:
>
>> Hello,
>>
>> On 10/13/2016 02:50 AM, NeilBrown wrote:
>>>
>>> nfs-server-generator is run very early when a lot of services
>>> are not yet started, so it mustn't depend on them.
>>> Currently it can try to use hostname lookup and syslog.
>>>
>>> Hostname-lookup is not needed, as we don't use the host issue,
>>> and sending message to stderr is sufficient for the generator.
>>>
>>> Disabling syslog is easy - call a function that sets a static variable.
>>>
>>> Disabling hostname lookup isn't quite so easy, so add a static variable
>>> which can be set to disable it.
>>>
>>> Signed-off-by: NeilBrown <neilb@suse.com>
>>> ---
>>>
>>> hi,
>>> I contemplated passing another arg to export_read() and export_d_read()
>>> to resolve this, but it didn't seem worth it.
>>>
>>> Is this approach OK to people?
>> It's not the most eloquent interface I've
>> ever seen... ;-)
>>
>> What are the failures this is fixing? When a
>> hostname lookup is done what happens? Failure
>> hangs stopping the server from coming up?
>
> I never actually reproduced it myself, but I think that when hostname
> lookup failed (possibly after a timeout) it tried to log an error via
> syslog and writing to syslog blocked indefinitely.
> The systemd.generator manpage explicitly rules out trying to talk to
> syslog.
This makes sense...
>
>
>>
>>
>>>
>>> Thanks,
>>> NeilBrown
>>>
>>>
>>> support/export/export.c | 12 ++++++++++--
>>> support/include/exportfs.h | 1 +
>>> systemd/nfs-server-generator.c | 4 ++++
>>> 3 files changed, 15 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/support/export/export.c b/support/export/export.c
>>> index 0b8a858c2c74..c65dc8807a4e 100644
>>> --- a/support/export/export.c
>>> +++ b/support/export/export.c
>>> @@ -67,6 +67,14 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
>>> }
>>> }
>> If we do have to stay with this approach,
>> I definitely think comment explaining
>> why its needed and what it does.
>
> That's sensible. I'll resend with some nice friendly comments.
Thanks!
>
>>
>> Finally, on an unrelated issue I'm seeing
>> SELinux preventing nfs-server-generator from
>> accessing nfs-server.service.d/order-with-mounts.conf
>> because of a labeling issue. I guess the label
>> should be nfsd_unit_file_t not systemd_unit_file_t
>
> I wouldn't know about that :-(
I'll figure this out...
steved.
>
> Thanks,
> NeilBrown
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH nfs-utils v2] nfs-server-generator: avoid using external services.
2016-11-01 22:03 ` Steve Dickson
@ 2016-11-02 0:25 ` NeilBrown
2016-11-07 19:16 ` Steve Dickson
0 siblings, 1 reply; 6+ messages in thread
From: NeilBrown @ 2016-11-02 0:25 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing List
[-- Attachment #1: Type: text/plain, Size: 4790 bytes --]
nfs-server-generator is run very early when a lot of services are not
yet started, so it mustn't depend on them. Currently it can try to
use hostname lookup and syslog. Using hostname lookup can cause
errors and when these are logged via syslog, it can cause the
generator to block indefinitely
Hostname-lookup is not needed, as we don't use the host issue,
and sending message to stderr is sufficient for the generator.
Disabling syslog is easy - call a function that sets a static variable.
Disabling hostname lookup requires adding an "ignore_hosts" flags to
export_read and export_d_read().
Signed-off-by: NeilBrown <neilb@suse.com>
---
Hi Steve,
I decided that you were right and the interface wasn't really very
nice.
And it wasn't that hard to make a more sensible interface.
So I did that. Less need for comments, but I put an appropriate
comment in anyway.
Thanks,
NeilBrown
support/export/export.c | 13 +++++++++----
support/include/exportfs.h | 4 ++--
systemd/nfs-server-generator.c | 4 ++--
utils/exportfs/exportfs.c | 4 ++--
4 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/support/export/export.c b/support/export/export.c
index 0b8a858c2c74..15e91cb3eb71 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -70,11 +70,15 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
/**
* export_read - read entries from /etc/exports
* @fname: name of file to read from
+ * @ignore_hosts: don't check validity of host names
*
* Returns number of read entries.
+ * @ignore_hosts can be set when the host names won't be used
+ * and when getting delays or errors due to problems with
+ * hostname looking is not acceptable.
*/
int
-export_read(char *fname)
+export_read(char *fname, int ignore_hosts)
{
struct exportent *eep;
nfs_export *exp;
@@ -83,7 +87,7 @@ export_read(char *fname)
setexportent(fname, "r");
while ((eep = getexportent(0,1)) != NULL) {
- exp = export_lookup(eep->e_hostname, eep->e_path, 0);
+ exp = export_lookup(eep->e_hostname, eep->e_path, ignore_hosts);
if (!exp) {
if (export_create(eep, 0))
/* possible complaints already logged */
@@ -100,13 +104,14 @@ export_read(char *fname)
/**
* export_d_read - read entries from /etc/exports.
* @fname: name of directory to read from
+ * @ignore_hosts: don't check validity of host names
*
* Returns number of read entries.
* Based on mnt_table_parse_dir() in
* util-linux-ng/shlibs/mount/src/tab_parse.c
*/
int
-export_d_read(const char *dname)
+export_d_read(const char *dname, int ignore_hosts)
{
int n = 0, i;
struct dirent **namelist = NULL;
@@ -150,7 +155,7 @@ export_d_read(const char *dname)
continue;
}
- volumes += export_read(fname);
+ volumes += export_read(fname, ignore_hosts);
}
for (i = 0; i < n; i++)
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index f033329b5fd2..32d4fe95fd7e 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -134,8 +134,8 @@ struct addrinfo * client_resolve(const struct sockaddr *sap);
int client_member(const char *client,
const char *name);
-int export_read(char *fname);
-int export_d_read(const char *dname);
+int export_read(char *fname, int ignore_hosts);
+int export_d_read(const char *dname, int ignore_hosts);
void export_reset(nfs_export *);
nfs_export * export_lookup(char *hname, char *path, int caconical);
nfs_export * export_find(const struct addrinfo *ai,
diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
index af8bb52bfbd7..44895f1f8582 100644
--- a/systemd/nfs-server-generator.c
+++ b/systemd/nfs-server-generator.c
@@ -102,8 +102,8 @@ int main(int argc, char *argv[])
path = malloc(strlen(argv[1]) + sizeof(dirbase) + sizeof(filebase));
if (!path)
exit(2);
- if (export_read(_PATH_EXPORTS) +
- export_d_read(_PATH_EXPORTS_D) == 0)
+ if (export_read(_PATH_EXPORTS, 1) +
+ export_d_read(_PATH_EXPORTS_D, 1) == 0)
/* Nothing is exported, so nothing to do */
exit(0);
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 4ac2c15ae13e..5136810029d0 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -183,8 +183,8 @@ main(int argc, char **argv)
atexit(release_lockfile);
if (f_export && ! f_ignore) {
- if (! (export_read(_PATH_EXPORTS) +
- export_d_read(_PATH_EXPORTS_D))) {
+ if (! (export_read(_PATH_EXPORTS, 0) +
+ export_d_read(_PATH_EXPORTS_D, 0))) {
if (f_verbose)
xlog(L_WARNING, "No file systems exported!");
}
--
2.10.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH nfs-utils v2] nfs-server-generator: avoid using external services.
2016-11-02 0:25 ` [PATCH nfs-utils v2] " NeilBrown
@ 2016-11-07 19:16 ` Steve Dickson
0 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2016-11-07 19:16 UTC (permalink / raw)
To: NeilBrown; +Cc: Linux NFS Mailing List
On 11/01/2016 08:25 PM, NeilBrown wrote:
> nfs-server-generator is run very early when a lot of services are not
> yet started, so it mustn't depend on them. Currently it can try to
> use hostname lookup and syslog. Using hostname lookup can cause
> errors and when these are logged via syslog, it can cause the
> generator to block indefinitely
>
> Hostname-lookup is not needed, as we don't use the host issue,
> and sending message to stderr is sufficient for the generator.
>
> Disabling syslog is easy - call a function that sets a static variable.
>
> Disabling hostname lookup requires adding an "ignore_hosts" flags to
> export_read and export_d_read().
>
> Signed-off-by: NeilBrown <neilb@suse.com>
Committed!
steved.
> ---
>
> Hi Steve,
> I decided that you were right and the interface wasn't really very
> nice.
> And it wasn't that hard to make a more sensible interface.
> So I did that. Less need for comments, but I put an appropriate
> comment in anyway.
>
> Thanks,
> NeilBrown
>
>
> support/export/export.c | 13 +++++++++----
> support/include/exportfs.h | 4 ++--
> systemd/nfs-server-generator.c | 4 ++--
> utils/exportfs/exportfs.c | 4 ++--
> 4 files changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/support/export/export.c b/support/export/export.c
> index 0b8a858c2c74..15e91cb3eb71 100644
> --- a/support/export/export.c
> +++ b/support/export/export.c
> @@ -70,11 +70,15 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
> /**
> * export_read - read entries from /etc/exports
> * @fname: name of file to read from
> + * @ignore_hosts: don't check validity of host names
> *
> * Returns number of read entries.
> + * @ignore_hosts can be set when the host names won't be used
> + * and when getting delays or errors due to problems with
> + * hostname looking is not acceptable.
> */
> int
> -export_read(char *fname)
> +export_read(char *fname, int ignore_hosts)
> {
> struct exportent *eep;
> nfs_export *exp;
> @@ -83,7 +87,7 @@ export_read(char *fname)
>
> setexportent(fname, "r");
> while ((eep = getexportent(0,1)) != NULL) {
> - exp = export_lookup(eep->e_hostname, eep->e_path, 0);
> + exp = export_lookup(eep->e_hostname, eep->e_path, ignore_hosts);
> if (!exp) {
> if (export_create(eep, 0))
> /* possible complaints already logged */
> @@ -100,13 +104,14 @@ export_read(char *fname)
> /**
> * export_d_read - read entries from /etc/exports.
> * @fname: name of directory to read from
> + * @ignore_hosts: don't check validity of host names
> *
> * Returns number of read entries.
> * Based on mnt_table_parse_dir() in
> * util-linux-ng/shlibs/mount/src/tab_parse.c
> */
> int
> -export_d_read(const char *dname)
> +export_d_read(const char *dname, int ignore_hosts)
> {
> int n = 0, i;
> struct dirent **namelist = NULL;
> @@ -150,7 +155,7 @@ export_d_read(const char *dname)
> continue;
> }
>
> - volumes += export_read(fname);
> + volumes += export_read(fname, ignore_hosts);
> }
>
> for (i = 0; i < n; i++)
> diff --git a/support/include/exportfs.h b/support/include/exportfs.h
> index f033329b5fd2..32d4fe95fd7e 100644
> --- a/support/include/exportfs.h
> +++ b/support/include/exportfs.h
> @@ -134,8 +134,8 @@ struct addrinfo * client_resolve(const struct sockaddr *sap);
> int client_member(const char *client,
> const char *name);
>
> -int export_read(char *fname);
> -int export_d_read(const char *dname);
> +int export_read(char *fname, int ignore_hosts);
> +int export_d_read(const char *dname, int ignore_hosts);
> void export_reset(nfs_export *);
> nfs_export * export_lookup(char *hname, char *path, int caconical);
> nfs_export * export_find(const struct addrinfo *ai,
> diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
> index af8bb52bfbd7..44895f1f8582 100644
> --- a/systemd/nfs-server-generator.c
> +++ b/systemd/nfs-server-generator.c
> @@ -102,8 +102,8 @@ int main(int argc, char *argv[])
> path = malloc(strlen(argv[1]) + sizeof(dirbase) + sizeof(filebase));
> if (!path)
> exit(2);
> - if (export_read(_PATH_EXPORTS) +
> - export_d_read(_PATH_EXPORTS_D) == 0)
> + if (export_read(_PATH_EXPORTS, 1) +
> + export_d_read(_PATH_EXPORTS_D, 1) == 0)
> /* Nothing is exported, so nothing to do */
> exit(0);
>
> diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
> index 4ac2c15ae13e..5136810029d0 100644
> --- a/utils/exportfs/exportfs.c
> +++ b/utils/exportfs/exportfs.c
> @@ -183,8 +183,8 @@ main(int argc, char **argv)
> atexit(release_lockfile);
>
> if (f_export && ! f_ignore) {
> - if (! (export_read(_PATH_EXPORTS) +
> - export_d_read(_PATH_EXPORTS_D))) {
> + if (! (export_read(_PATH_EXPORTS, 0) +
> + export_d_read(_PATH_EXPORTS_D, 0))) {
> if (f_verbose)
> xlog(L_WARNING, "No file systems exported!");
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-07 19:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 6:50 [PATCH nfs-utils] nfs-server-generator: avoid using external services NeilBrown
2016-11-01 18:45 ` Steve Dickson
2016-11-01 19:55 ` NeilBrown
2016-11-01 22:03 ` Steve Dickson
2016-11-02 0:25 ` [PATCH nfs-utils v2] " NeilBrown
2016-11-07 19:16 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).