From d2ead58ce48a5e87532f321b618d9e53ad06e596 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 16 Mar 2016 14:04:20 -0700 Subject: [PATCH] scoutfs: translate d_type in readdir I had forgotten to translate from the scoutfs types in items to the vfs types for filldir() so userspace was seeing garbage d_type values. Signed-off-by: Zach Brown --- kmod/src/dir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kmod/src/dir.c b/kmod/src/dir.c index 4ba72db1..66d9006f 100644 --- a/kmod/src/dir.c +++ b/kmod/src/dir.c @@ -67,7 +67,6 @@ static unsigned int mode_to_type(umode_t mode) #undef S_SHIFT } -#if 0 static unsigned int dentry_type(unsigned int type) { static unsigned char types[] = { @@ -86,7 +85,6 @@ static unsigned int dentry_type(unsigned int type) return DT_UNKNOWN; } -#endif static int names_equal(const char *name_a, int len_a, const char *name_b, int len_b) @@ -310,7 +308,8 @@ static int scoutfs_readdir(struct file *file, void *dirent, filldir_t filldir) continue; if (filldir(dirent, dent->name, dent->name_len, pos, - le64_to_cpu(dent->ino), dent->type)) + le64_to_cpu(dent->ino), + dentry_type(dent->type))) break; file->f_pos = (pos | dent->coll_nr) + 1;