Coda File System

Re: venus 5.3.19 and linux 2.6.0-test9

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Mon, 10 Nov 2003 09:51:09 -0500
On Sat, Nov 08, 2003 at 06:07:35PM +0100, Florian Schaefer wrote:
> On Sat, 8 Nov 2003 17:45:19 +0100 (MET), Ivan Popov said:
> > > What have I done wrong?
> > 
> > Most probably nothing?
> > 
> > I haven't looked at the newest kernel sources, but I can think that there
> > is a bug in the configuration.
> > 
> > The fix should be trivial, but I'd rather go with upgrading to the new
> > realm-aware Coda - there are more and more fixes and changes, and
> > of course the new functionality.
...
> Furthermore, IMHO if there's an option for backward compatibility it
> should at least work. If I understand the state of the current kernel
> correctly, Linus tries to get the number of patches for the -test10 down
> in order to prepare a first 2.6.0 release, and if this is a real bug
> something should be done about it.

Yes, there is a config option CODA_FS_OLD_API, which enables the old
96-bit fids. However... someone came up with the great idea to have the
#define associated with config options start with CONFIG_.

So the initial patch that Linus merged is testing for the wrong thing in
the ifdefs. I followed up with a patch that changes every ifdef to test
for the right preprocessor symbol, but it doesn't seem to have been
applied yet.

But this is the patch that 2.6.0-test is missing to get the old 96-bit
API to work.

Jan

diff -urN linux-2.6.0-test9/fs/coda/coda_linux.c linux-2.6.0-test9-coda/fs/coda/coda_linux.c
--- linux-2.6.0-test9/fs/coda/coda_linux.c	2003-09-28 23:43:44.000000000 -0400
+++ linux-2.6.0-test9-coda/fs/coda/coda_linux.c	2003-10-29 11:12:26.000000000 -0500
@@ -28,7 +28,7 @@
 char * coda_f2s(struct CodaFid *f)
 {
 	static char s[60];
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
  	sprintf(s, "(%08x.%08x.%08x)", f->opaque[0], f->opaque[1], f->opaque[2]);
 #else
  	sprintf(s, "(%08x.%08x.%08x.%08x)", f->opaque[0], f->opaque[1], f->opaque[2], f->opaque[3]);
diff -urN linux-2.6.0-test9/fs/coda/psdev.c linux-2.6.0-test9-coda/fs/coda/psdev.c
--- linux-2.6.0-test9/fs/coda/psdev.c	2003-09-28 23:43:44.000000000 -0400
+++ linux-2.6.0-test9-coda/fs/coda/psdev.c	2003-10-29 11:12:31.000000000 -0500
@@ -385,7 +385,7 @@
 	int status;
 	int i;
 	printk(KERN_INFO "Coda Kernel/Venus communications, "
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	       "v5.3.20"
 #else
 	       "v6.0.0"
diff -urN linux-2.6.0-test9/fs/coda/upcall.c linux-2.6.0-test9-coda/fs/coda/upcall.c
--- linux-2.6.0-test9/fs/coda/upcall.c	2003-09-28 23:43:44.000000000 -0400
+++ linux-2.6.0-test9-coda/fs/coda/upcall.c	2003-10-29 11:12:55.000000000 -0500
@@ -55,7 +55,7 @@
         inp->ih.opcode = opcode;
 	inp->ih.pid = current->pid;
 	inp->ih.pgid = process_group(current);
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	memset(&inp->ih.cred, 0, sizeof(struct coda_cred));
 	inp->ih.cred.cr_fsuid = current->fsuid;
 #else
@@ -172,7 +172,7 @@
         union inputArgs *inp;
         union outputArgs *outp;
         int insize, outsize, error;
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	struct coda_cred cred = { 0, };
 	cred.cr_fsuid = uid;
 #endif
@@ -180,7 +180,7 @@
 	insize = SIZE(store);
 	UPARG(CODA_STORE);
 	
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	memcpy(&(inp->ih.cred), &cred, sizeof(cred));
 #else
 	inp->ih.uid = uid;
@@ -219,7 +219,7 @@
 	union inputArgs *inp;
 	union outputArgs *outp;
 	int insize, outsize, error;
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	struct coda_cred cred = { 0, };
 	cred.cr_fsuid = uid;
 #endif
@@ -227,7 +227,7 @@
 	insize = SIZE(release);
 	UPARG(CODA_CLOSE);
 	
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 	memcpy(&(inp->ih.cred), &cred, sizeof(cred));
 #else
 	inp->ih.uid = uid;
diff -urN linux-2.6.0-test9/include/linux/coda.h linux-2.6.0-test9-coda/include/linux/coda.h
--- linux-2.6.0-test9/include/linux/coda.h	2003-09-28 23:44:08.000000000 -0400
+++ linux-2.6.0-test9-coda/include/linux/coda.h	2003-10-29 11:11:50.000000000 -0500
@@ -200,7 +200,7 @@
 typedef u_int32_t vgid_t;
 #endif /*_VUID_T_ */
 
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 struct CodaFid {
 	u_int32_t opaque[3];
 };
@@ -220,7 +220,7 @@
     vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
 };
 
-#else /* not defined(CODA_FS_OLD_API) */
+#else /* not defined(CONFIG_CODA_FS_OLD_API) */
 
 struct CodaFid {
 	u_int32_t opaque[4];
@@ -318,7 +318,7 @@
 #define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
 #define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
 #endif
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
 #define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */
 #else
 #define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
@@ -330,7 +330,7 @@
 struct coda_in_hdr {
     u_int32_t opcode;
     u_int32_t unique;	    /* Keep multiple outstanding msgs distinct */
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
     u_int16_t pid;	    /* Common to all */
     u_int16_t pgid;	    /* Common to all */
     u_int16_t sid;          /* Common to all */
@@ -614,7 +614,7 @@
 /* CODA_PURGEUSER is a venus->kernel call */
 struct coda_purgeuser_out {
     struct coda_out_hdr oh;
-#ifdef CODA_FS_OLD_API
+#ifdef CONFIG_CODA_FS_OLD_API
     struct coda_cred cred;
 #else
     vuid_t uid;
Received on 2003-11-10 09:53:41