patch-2.4.22 linux-2.4.22/fs/coda/dir.c

Next file: linux-2.4.22/fs/coda/file.c
Previous file: linux-2.4.22/fs/buffer.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/fs/coda/dir.c linux-2.4.22/fs/coda/dir.c
@@ -79,6 +79,7 @@
 };
 
 struct file_operations coda_dir_operations = {
+	llseek:		generic_file_llseek,
 	read:		generic_read_dir,
 	readdir:	coda_readdir,
 	open:		coda_open,
@@ -507,7 +508,11 @@
 		ret = coda_venus_readdir(host_file, filldir, dirent, coda_dentry);
 	} else {
 		/* potemkin case: we were handed a directory inode */
-		ret = vfs_readdir(host_file, filldir, dirent);
+		/* We can't call vfs_readdir because we are already holding
+		 * the inode semaphore. */
+		ret = -ENOENT;
+		if (!IS_DEADDIR(host_file->f_dentry->d_inode))
+			ret = host_file->f_op->readdir(host_file, filldir, dirent);
 	}
 
 	coda_file->f_pos = host_file->f_pos;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)