svn2cvs converter script

This script converts a sub-tree of an SVN repository to CVS. It works incrementally, i.e. can be used to keep a CVS repository in sync with an SVN repository. Configuration must be done directly by modifying the script itself.

32-bit quota on 64-bit Linux kernel with XFS

Running a 64-bit kernel with 32-bit userland together with the XFS filesystem reveals a problem with the data structures copied between user and kernel. The fs_quota_stat structure has different sizes in 32-bit and 64-bit environments. In this case the kernel structure is bigger than the user structure and thus the kernel overwrites parts of the user stack, leading to a segmentation fault or other corruption of the quota program. To fix this problem we have developed a patch that adapts the size of the structure used in the quota program to the size of the structure in the kernel.

--- quota-3.14/quotaio_xfs.h	2003-10-13 09:17:56.000000000 +0200
+++ quota-3.14-a/quotaio_xfs.h	2007-04-23 15:15:31.682040000 +0200
@@ -131,12 +131,15 @@
 	__u64 qfs_ino;		/* inode number */
 	__u64 qfs_nblks;	/* number of BBs 512-byte-blks */
 	__u32 qfs_nextents;	/* number of extents */
-} fs_qfilestat_t;
+	__s8 __pad1[4];
+} __attribute__((packed)) fs_qfilestat_t;
 
 typedef struct fs_quota_stat {
 	__s8 qs_version;	/* version number for future changes */
+	__s8 _p0;
 	__u16 qs_flags;		/* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
 	__s8 qs_pad;		/* unused */
+	__s8 _p1[3];
 	fs_qfilestat_t qs_uquota;	/* user quota storage information */
 	fs_qfilestat_t qs_gquota;	/* group quota storage information */
 	__u32 qs_incoredqs;	/* number of dquots incore */
@@ -145,6 +148,7 @@
 	__s32 qs_rtbtimelimit;	/* limit for rt blks timer */
 	__u16 qs_bwarnlimit;	/* limit for num warnings */
 	__u16 qs_iwarnlimit;	/* limit for num warnings */
-} fs_quota_stat_t;
+	__s8  _p2[4];
+} __attribute__((packed)) fs_quota_stat_t;
 
 #endif /* _QUOTAIO_XFS_H */