summaryrefslogtreecommitdiffstats
path: root/fs/hostfs/hostfs_user.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2012-01-27 19:14:58 +0100
committerRichard Weinberger <richard@nod.at>2012-03-25 00:29:52 +0100
commit3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb (patch)
treeb1050db82803495116ac255a2b6c755622bd1044 /fs/hostfs/hostfs_user.c
parentc0b79a90b1556a7e51d7a49a655eb60306f6258d (diff)
downloadtalos-obmc-linux-3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb.tar.gz
talos-obmc-linux-3ee6bd8e8dc0c58b9ba5bab7ef8a7a131da346eb.zip
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_user.c')
-rw-r--r--fs/hostfs/hostfs_user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c
index dd7bc38a3825..a74ad0d371c2 100644
--- a/fs/hostfs/hostfs_user.c
+++ b/fs/hostfs/hostfs_user.c
@@ -98,7 +98,8 @@ void *open_dir(char *path, int *err_out)
}
char *read_dir(void *stream, unsigned long long *pos,
- unsigned long long *ino_out, int *len_out)
+ unsigned long long *ino_out, int *len_out,
+ unsigned int *type_out)
{
DIR *dir = stream;
struct dirent *ent;
@@ -109,6 +110,7 @@ char *read_dir(void *stream, unsigned long long *pos,
return NULL;
*len_out = strlen(ent->d_name);
*ino_out = ent->d_ino;
+ *type_out = ent->d_type;
*pos = telldir(dir);
return ent->d_name;
}
OpenPOWER on IntegriCloud