This file is indexed.

/usr/src/kernel-patches/lustre/patches/hostfs_readdir_large.patch is in linux-patch-lustre 1.8.5+dfsg-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: linux-2.6.10/fs/hostfs/hostfs_user.c
===================================================================
--- linux-2.6.10.orig/fs/hostfs/hostfs_user.c	2004-12-25 05:35:15.000000000 +0800
+++ linux-2.6.10/fs/hostfs/hostfs_user.c	2005-03-31 19:26:03.810175656 +0800
@@ -121,13 +121,26 @@
 {
 	DIR *dir = stream;
 	struct dirent *ent;
+        off_t off = 0;
+        off_t after_seek = 0;
+        off_t after_readdir = 0;
+        off_t after_readdir2 = 0;
 
 	seekdir(dir, *pos);
+        after_seek = telldir(dir);
 	ent = readdir(dir);
+	after_readdir = telldir(dir);
+	if ( after_seek != after_readdir ) {
+		off = after_readdir;
+	} else {
+		readdir(dir);
+		after_readdir2 = telldir(dir);
+		off = after_readdir2;
+	}
 	if(ent == NULL) return(NULL);
 	*len_out = strlen(ent->d_name);
 	*ino_out = ent->d_ino;
-	*pos = telldir(dir);
+	*pos = off;
 	return(ent->d_name);
 }