public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4.23, 2.6.0-test11] fix d_type in readdir in isofs
@ 2003-12-09  9:47 Domen Puncer
  2003-12-09 10:09 ` viro
  2003-12-09 16:28 ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: Domen Puncer @ 2003-12-09  9:47 UTC (permalink / raw)
  To: Linux Kernel

Hi!

Played with scandir, and noticed iso9660's files d_type is always 0,
so here's a fix.

If there are no objections i'll try to fix some other filesystems too.

2.6.0-test11:
--- c/fs/isofs/dir.c	2003-08-23 01:58:53.000000000 +0200
+++ a/fs/isofs/dir.c	2003-12-09 10:29:21.000000000 +0100
@@ -230,7 +230,8 @@
 			}
 		}
 		if (len > 0) {
-			if (filldir(dirent, p, len, filp->f_pos, inode_number, DT_UNKNOWN) < 0)
+			if (filldir(dirent, p, len, filp->f_pos, inode_number,
+					(de->flags[0]&2)?DT_DIR:DT_REG) < 0)
 				break;
 		}
 		filp->f_pos += de_len;


2.4.23:
--- linux-2.4.23-clean/fs/isofs/dir.c	2002-02-25 20:38:08.000000000 +0100
+++ linux-2.4.23/fs/isofs/dir.c	2003-12-09 10:28:58.000000000 +0100
@@ -230,7 +230,8 @@
 			}
 		}
 		if (len > 0) {
-			if (filldir(dirent, p, len, filp->f_pos, inode_number, DT_UNKNOWN) < 0)
+			if (filldir(dirent, p, len, filp->f_pos, inode_number,
+					(de->flags[0]&2)?DT_DIR:DT_REG) < 0)
 				break;
 		}
 		filp->f_pos += de_len;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-09 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-09  9:47 [PATCH 2.4.23, 2.6.0-test11] fix d_type in readdir in isofs Domen Puncer
2003-12-09 10:09 ` viro
2003-12-09 13:45   ` Domen Puncer
2003-12-09 16:28 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox