[OpenAFS-devel] [patch] sr/afs/LINUX/osi_vnodeops.c and wrong direntry type

Sam Hartman hartmans@mit.edu
Thu, 29 Mar 2001 14:43:05 -0500


Under 2.4.x kernels, there is a file type in the result of readdir to
help applications optimize directory traversal.  With usfficiently new
libc compiled against sufficiently new kernel headers, this is exported to applications.  

Several applications, including fileutils use this information.  AFS
asserts that all files are directories.  This sucks, because among
other things it causes rm -rf not to work.

--- osi_vnodeops.c~	Wed Mar  7 03:58:25 2001
+++ osi_vnodeops.c	Wed Mar 28 18:54:41 2001
@@ -231,7 +231,7 @@
 
 	/* filldir returns -EINVAL when the buffer is full. */
 #ifdef AFS_LINUX24_ENV
-	code = (*filldir)(dirbuf, de->name, len, offset, ino, DT_DIR);
+	code = (*filldir)(dirbuf, de->name, len, offset, ino, DT_UNKNOWN);
 #else
 	code = (*filldir)(dirbuf, de->name, len, offset, ino); 
 #endif