Module Name: src
Committed By: martin
Date: Thu Jun 5 13:14:23 UTC 2014
Modified Files:
src/lib/libquota: quota_nfs.c
Log Message:
If a rpc for quota values fails with ENOTCONN translate this to ENOENT - we
certainly don't have any quotas if they are disabled on the file server.
This silences warnings from things like "quota -u -v" when NFS mounts
are present and no quotas are in use on the file server.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/quota_nfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libquota/quota_nfs.c
diff -u src/lib/libquota/quota_nfs.c:1.2 src/lib/libquota/quota_nfs.c:1.3
--- src/lib/libquota/quota_nfs.c:1.2 Mon Jan 30 06:39:26 2012
+++ src/lib/libquota/quota_nfs.c Thu Jun 5 13:14:23 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: quota_nfs.c,v 1.2 2012/01/30 06:39:26 dholland Exp $ */
+/* $NetBSD: quota_nfs.c,v 1.3 2014/06/05 13:14:23 martin Exp $ */
/*-
* Copyright (c) 2011 Manuel Bouyer
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_nfs.c,v 1.2 2012/01/30 06:39:26 dholland Exp $");
+__RCSID("$NetBSD: quota_nfs.c,v 1.3 2014/06/05 13:14:23 martin Exp $");
#include <sys/types.h>
#include <sys/param.h> /* XXX for DEV_BSIZE */
@@ -191,7 +191,9 @@ __quota_nfs_get(struct quotahandle *qh,
free(host);
if (ret != RPC_SUCCESS) {
- errno = sverrno;
+ /* if the file server does not support any quotas at all,
+ return ENOENT */
+ errno = sverrno == ENOTCONN ? ENOENT : sverrno;
return -1;
}