On Friday December 16, [email protected] wrote:
>
> I have just make a RC release for nfs-utils.
> nfs-utils-1.0.8-rc1 can be found at
>
> http://sourceforge.net/project/showfiles.php?group_id=14
> or (soon) at
> http://www.{countrycode}.kernel.org/pub/linux/utils/nfs/
Now there is an -rc2.
It has a large update to the autoconf infrastructure.
It would be helpful to know that it builds successfully in various
configurations on various distributions.
Please report any problems.
Thanks,
NeilBrown
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Hi Neil,
There is a problem in rquotad compilation when compiling nfs-utils on a=20
SLES 9 for ppc64:
Making all in rquotad
make[2]: Entering directory `/usr/src/nfs-utils-1.0.8-rc2/utils/rquotad'
if gcc -DHAVE_CONFIG_H -I. -I. -I../../support/include =20
-I../../support/include -D_FILE_OFFSET_BITS=3D64 -D_GNU_SOURCE=20
-I../../support/export -D_GNU_SOURCE -Wall -pipe -g -O2 -MT=20
rquotad-rquota_server.o -MD -MP -MF ".deps/rquotad-rquota_server.Tpo" -c=20
-o rquotad-rquota_server.o `test -f 'rquota_server.c' || echo=20
'./'`rquota_server.c; \
then mv -f ".deps/rquotad-rquota_server.Tpo"=20
".deps/rquotad-rquota_server.Po"; else rm -f=20
".deps/rquotad-rquota_server.Tpo"; exit 1; fi
rquota_server.c: In function `getquotainfo':
rquota_server.c:78: error: storage size of `dq_dqb' isn't known
rquota_server.c:146: warning: implicit declaration of function `dqoff'
rquota_server.c:147: error: invalid application of `sizeof' to an=20
incomplete type
rquota_server.c:153: error: invalid application of `sizeof' to an=20
incomplete type
rquota_server.c:155: error: invalid application of `sizeof' to an=20
incomplete type
rquota_server.c:155: error: duplicate case value
rquota_server.c:148: error: previously used here
rquota_server.c:78: warning: unused variable `dq_dqb'
In sys/quota.h :
struct dqblk
{
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
u_int32_t dqb_curblocks; /* current block count */
u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
u_int32_t dqb_isoftlimit; /* preferred inode limit */
u_int32_t dqb_curinodes; /* current # allocated inodes */
time_t dqb_btime; /* time limit for excessive disk use */
time_t dqb_itime; /* time limit for excessive files */
};
Is replaced by that structure on a SLES9 ppc64:
struct if_dqblk {
u_int64_t dqb_bhardlimit;
u_int64_t dqb_bsoftlimit;
u_int64_t dqb_curspace;
u_int64_t dqb_ihardlimit;
u_int64_t dqb_isoftlimit;
u_int64_t dqb_curinodes;
u_int64_t dqb_btime;
u_int64_t dqb_itime;
u_int32_t dqb_valid;
};
It is not a new problem, it had also occured with nfs-utils-1.0.7.
Aur=E9lien
Neil Brown wrote:
>On Friday December 16, [email protected] wrote:
> =20
>
>>I have just make a RC release for nfs-utils.
>>nfs-utils-1.0.8-rc1 can be found at
>>
>> http://sourceforge.net/project/showfiles.php?group_id=3D14
>>or (soon) at
>> http://www.{countrycode}.kernel.org/pub/linux/utils/nfs/
>> =20
>>
>
>Now there is an -rc2.=20
>It has a large update to the autoconf infrastructure.=20
>It would be helpful to know that it builds successfully in various
>configurations on various distributions.
>Please report any problems.
>
>Thanks,
>NeilBrown
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log f=
iles
>for problems? Stop! Download the new AJAX search engine that makes
>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
>_______________________________________________
>NFS maillist - [email protected]
>https://lists.sourceforge.net/lists/listinfo/nfs
>
> =20
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
On Tuesday December 20, [email protected] wrote:
> Hi Neil,
>
> There is a problem in rquotad compilation when compiling nfs-utils on a
> SLES 9 for ppc64:
Yes... (grumble...)
The quota syscall interface to the kernel changed substantially in
2.6, with no back-comparability support for old applications.
(It is easy to tell which interface to use, so it isn't hard to write
portable apps, but old apps just break).
The
#define _LINUX_QUOTA_VERSION 1
that we put in allows it to compile on SL10 and newer Redhat etc, but
the code created won't work on 2.6 :-(
I guess I'd better fix it....
Thanks,
NeilBrown
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
On Wednesday December 21, [email protected] wrote:
>
> I guess I'd better fix it....
>
Does this patch
a/ look ok (if a bit heavy handed).
b/ compile for you?
Thanks,
NeilBrown
Index: utils/rquotad/rquota_server.c
===================================================================
RCS file: /cvsroot/nfs/nfs-utils/utils/rquotad/rquota_server.c,v
retrieving revision 1.9
diff -u -r1.9 rquota_server.c
--- utils/rquotad/rquota_server.c 20 Dec 2005 04:12:47 -0000 1.9
+++ utils/rquotad/rquota_server.c 21 Dec 2005 03:21:09 -0000
@@ -22,14 +22,20 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#define _LINUX_QUOTA_VERSION 1
#include <rpc/rpc.h>
#include "rquota.h"
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/param.h>
+/* Unfortunately we cannot trust sys/quota.h to have
+ * what we need, either the old interface could be missing
+ * (SLES9) or the new (SLES8 and others).
+ * So we will just put it explicitly below
+ */
+#if 0
#include <sys/quota.h>
+#endif
#include <sys/mount.h>
#include <dirent.h>
#include <paths.h>
@@ -50,6 +56,47 @@
#define BLOCK_SIZE 1024
#endif
+#define MAXQUOTAS 2
+#define USRQUOTA 0 /* element used for user quotas */
+#define GRPQUOTA 1 /* element used for group quotas */
+
+struct dqblk {
+ u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
+ u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
+ u_int32_t dqb_curblocks; /* current block count */
+ u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
+ u_int32_t dqb_isoftlimit; /* preferred inode limit */
+ u_int32_t dqb_curinodes; /* current # allocated inodes */
+ time_t dqb_btime; /* time limit for excessive disk use */
+ time_t dqb_itime; /* time limit for excessive files */
+};
+
+struct if_dqblk {
+ u_int64_t dqb_bhardlimit;
+ u_int64_t dqb_bsoftlimit;
+ u_int64_t dqb_curspace;
+ u_int64_t dqb_ihardlimit;
+ u_int64_t dqb_isoftlimit;
+ u_int64_t dqb_curinodes;
+ u_int64_t dqb_btime;
+ u_int64_t dqb_itime;
+ u_int32_t dqb_valid;
+};
+
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_GETQUOTA 0x0300 /* get limits and usage */
+#define Q_SETQUOTA 0x0400 /* set limits and usage */
+
+#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+#define Q_GETQUOTA_NEW 0x800007 /* get user quota structure */
+#define Q_SETQUOTA_NEW 0x800008 /* set user quota structure */
+#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+
+extern int quotactl (int __cmd, const char *__special, int __id,
+ caddr_t __addr) __THROW;
/*
* Global unix authentication credentials.
*/
@@ -75,12 +122,12 @@
ext_getquota_args *ext_args;
} arguments;
FILE *fp;
- struct dqblk dq_dqb;
struct mntent *mnt;
char *pathname, *qfpathname;
int fd, err, id, type;
struct stat stm, stn;
struct rquota *rquota;
+ struct if_dqblk dqb;
/*
* First check authentication.
@@ -134,32 +181,53 @@
result.getquota_rslt_u.gqr_rquota.rq_bsize = BLOCK_SIZE;
if (hasquota(mnt, type, &qfpathname)) {
- if ((err = quotactl(QCMD(Q_GETQUOTA, type), mnt->mnt_fsname,
- id, (caddr_t)&dq_dqb)) == -1
- && !(flags & ACTIVE)) {
- if ((fd = open(qfpathname, O_RDONLY)) < 0)
- {
- free(qfpathname);
- continue;
- }
- free(qfpathname);
- lseek(fd, (long) dqoff(id), L_SET);
- switch (read(fd, &dq_dqb, sizeof(struct dqblk))) {
- case 0:/* EOF */
- /*
- * Convert implicit 0 quota (EOF) into an
- * explicit one (zero'ed dqblk)
- */
- memset((caddr_t)&dq_dqb, 0, sizeof(struct dqblk));
- break;
- case sizeof(struct dqblk): /* OK */
- break;
- default: /* ERROR */
- close(fd);
- continue;
- }
- close(fd);
- }
+ int fmt;
+ if (quotactl(QCMD(Q_GETFMT, type), mnt->mnt_fsname, 0, (caddr_t)&fmt)==0) {
+ /* new style interface
+ * Don't bother trying to read from the file
+ */
+ err = quotactl(QCMD(Q_GETQUOTA_NEW, type),
+ mnt->mnt_fsname, id, (caddr_t)&dqb);
+ if (err) memset(&dqb, 0, sizeof(dqb));
+ } else {
+ /* old style */
+ struct dqblk dq_dqb;
+
+ if ((err = quotactl(QCMD(Q_GETQUOTA, type), mnt->mnt_fsname,
+ id, (caddr_t)&dq_dqb)) == -1
+ && !(flags & ACTIVE)) {
+ if ((fd = open(qfpathname, O_RDONLY)) < 0)
+ {
+ free(qfpathname);
+ continue;
+ }
+ free(qfpathname);
+ lseek(fd, (long) dqoff(id), L_SET);
+ switch (read(fd, &dq_dqb, sizeof(struct dqblk))) {
+ case 0:/* EOF */
+ /*
+ * Convert implicit 0 quota (EOF) into an
+ * explicit one (zero'ed dqblk)
+ */
+ memset((caddr_t)&dq_dqb, 0, sizeof(struct dqblk));
+ break;
+ case sizeof(struct dqblk): /* OK */
+ break;
+ default: /* ERROR */
+ close(fd);
+ continue;
+ }
+ close(fd);
+ }
+ dqb.dqb_bhardlimit = dq_dqb.dqb_bhardlimit;
+ dqb.dqb_bsoftlimit = dq_dqb.dqb_bsoftlimit;
+ dqb.dqb_curspace = dq_dqb.dqb_curblocks * 1024;
+ dqb.dqb_ihardlimit = dq_dqb.dqb_ihardlimit;
+ dqb.dqb_isoftlimit = dq_dqb.dqb_isoftlimit;
+ dqb.dqb_curinodes = dq_dqb.dqb_curinodes;
+ dqb.dqb_btime = dq_dqb.dqb_btime;
+ dqb.dqb_itime = dq_dqb.dqb_itime;
+ }
endmntent(fp);
if (err && (flags & ACTIVE)) {
@@ -175,14 +243,14 @@
*/
rquota = &result.getquota_rslt_u.gqr_rquota;
- rquota->rq_bhardlimit = dq_dqb.dqb_bhardlimit;
- rquota->rq_bsoftlimit = dq_dqb.dqb_bsoftlimit;;
- rquota->rq_curblocks = dq_dqb.dqb_curblocks;
- rquota->rq_fhardlimit = dq_dqb.dqb_ihardlimit;
- rquota->rq_fsoftlimit = dq_dqb.dqb_isoftlimit;
- rquota->rq_curfiles = dq_dqb.dqb_curinodes;
- rquota->rq_btimeleft = dq_dqb.dqb_btime;
- rquota->rq_ftimeleft = dq_dqb.dqb_itime;
+ rquota->rq_bhardlimit = dqb.dqb_bhardlimit;
+ rquota->rq_bsoftlimit = dqb.dqb_bsoftlimit;;
+ rquota->rq_curblocks = dqb.dqb_curspace/1024;
+ rquota->rq_fhardlimit = dqb.dqb_ihardlimit;
+ rquota->rq_fsoftlimit = dqb.dqb_isoftlimit;
+ rquota->rq_curfiles = dqb.dqb_curinodes;
+ rquota->rq_btimeleft = dqb.dqb_btime;
+ rquota->rq_ftimeleft = dqb.dqb_itime;
return(&result);
}
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Neil Brown wrote:
>On Wednesday December 21, [email protected] wrote:
> =20
>
>>I guess I'd better fix it....
>>
>Does this patch
> a/ look ok (if a bit heavy handed).
> b/ compile for you?
> =20
>
That is OK for that part
There is another problem for the compilation of hasquota.c, because=20
QUOTAFILENAME definition is missing in sys/quota.h
#define QUOTAFILENAME "quota"
is needed to compile
Thanks,
Aur=E9lien
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs