Coda File System

[PATCH] Coda

From: Peter J. Braam <braam_at_cs.cmu.edu>
Date: Tue, 12 May 1998 15:45:36 -0400 (EDT)
Linus, 

Some small fixes for Coda.  One of these is rather vital to get in.

 - file_write cleared instead of set a flag
 - coding error with O_RDONLY being 0
 - a debugging message derefenced NULL

Thanks for putting it in!

- Peter -

--- linux/fs/coda/cache.c	Wed May  6 18:34:24 1998
+++ linux-2.1.100b2.orig/fs/coda/cache.c	Tue May  5 17:56:05 1998
@@ -267,7 +267,8 @@
 	while ( alias != &inode->i_dentry ) {
 		alias_de = list_entry(alias, struct dentry, d_alias);
 		if ( !alias_de ) {
-			printk("Null alias list for inode %ld\n", inode->i_ino);
+			printk("Corrupt alias list for %*s\n",
+			       alias_de->d_name.len, alias_de->d_name.name);
 			return;
 		}
 		coda_flag_children(alias_de, flag);
--- linux/fs/coda/coda_linux.c	Wed May  6 18:34:29 1998
+++ linux-2.1.100b2.orig/fs/coda/coda_linux.c	Tue May  5 17:56:05 1998
@@ -94,10 +94,7 @@
 {
 	unsigned short coda_flags = 0;
 
-	if ( (flags & 0xf) == O_RDONLY )
-		coda_flags |= C_O_READ;
-
-	if ( flags &  O_RDWR )
+	if ( flags & (O_RDONLY | O_RDWR) )
 		coda_flags |= C_O_READ;
 
 	if ( flags & (O_WRONLY | O_RDWR) )
--- linux-2.1.100b2.orig/fs/coda/file.c	Tue May  5 17:56:05 1998
+++ linux/fs/coda/file.c	Fri May  8 11:52:56 1998
@@ -192,14 +192,14 @@
                 return -1;
         }
 
-        cnp->c_flags &= ~C_VATTR;
 
 	down(&cont_inode->i_sem);
         result = cont_file.f_op->write(&cont_file , buff, count, 
 				       &(cont_file.f_pos));
 	up(&cont_inode->i_sem);
         coda_restore_codafile(coda_inode, coda_file, cont_inode, &cont_file);
-
+	if ( result ) 
+               cnp->c_flags |= C_VATTR;
         return result;
 }
 
Received on 1998-05-12 15:47:35