diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-01-27 13:14:58 -0500 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-24 19:29:52 -0400 |
commit | 3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb (patch) | |
tree | b1050db82803495116ac255a2b6c755622bd1044 /fs/hostfs/hostfs_kern.c | |
parent | c0b79a90b1556a7e51d7a49a655eb60306f6258d (diff) |
uml/hostfs: Propagate dirent.d_type to filldir()
Currently the (optional) d_type member in struct dirent is always
DT_UNKNOWN on hostfs, which may confuse buggy software using readdir().
Make sure to propagate its value from the underlying filesystem if it's
available there.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index e130bd46d671..dc4222bd6e77 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -283,6 +283,7 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir) | |||
283 | char *name; | 283 | char *name; |
284 | unsigned long long next, ino; | 284 | unsigned long long next, ino; |
285 | int error, len; | 285 | int error, len; |
286 | unsigned int type; | ||
286 | 287 | ||
287 | name = dentry_name(file->f_path.dentry); | 288 | name = dentry_name(file->f_path.dentry); |
288 | if (name == NULL) | 289 | if (name == NULL) |
@@ -292,9 +293,9 @@ int hostfs_readdir(struct file *file, void *ent, filldir_t filldir) | |||
292 | if (dir == NULL) | 293 | if (dir == NULL) |
293 | return -error; | 294 | return -error; |
294 | next = file->f_pos; | 295 | next = file->f_pos; |
295 | while ((name = read_dir(dir, &next, &ino, &len)) != NULL) { | 296 | while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) { |
296 | error = (*filldir)(ent, name, len, file->f_pos, | 297 | error = (*filldir)(ent, name, len, file->f_pos, |
297 | ino, DT_UNKNOWN); | 298 | ino, type); |
298 | if (error) break; | 299 | if (error) break; |
299 | file->f_pos = next; | 300 | file->f_pos = next; |
300 | } | 301 | } |