[PATCH] Race in coda_readdir()

Alexander Viro (viro@math.psu.edu)
Fri, 19 Feb 1999 02:28:52 -0500 (EST)


coda_readdir() calls ->readdir() method of caching object without
holding the semaphore on it. Patch below is against 2.2.2-pre5.

--- linux/fs/coda/dir.c Tue Feb 16 11:53:48 1999
+++ linux/fs/coda/dir.c.new Fri Feb 19 02:20:50 1999
@@ -637,7 +637,9 @@
result = coda_venus_readdir(&open_file, dirent, filldir);
} else {
/* potemkin case: we are handed a directory inode */
+ down(&cnp->ovp->i_sem);
result = open_file.f_op->readdir(&open_file, dirent, filldir);
+ up(&cnp->ovp->i_sem);
}
coda_restore_codafile(inode, file, cnp->c_ovp, &open_file);
EXIT;

Cheers,
Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/