All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.4.23, 2.6.0-test11] fix d_type in readdir in isofs
Date: Tue, 09 Dec 2003 14:45:12 +0100	[thread overview]
Message-ID: <200312091445.12134.domen@coderock.org> (raw)
In-Reply-To: <20031209100959.GB4176@parcelfarce.linux.theplanet.co.uk>

On Tuesday 09 of December 2003 11:09, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Tue, Dec 09, 2003 at 10:47:32AM +0100, Domen Puncer wrote:
> > Hi!
> >
> > Played with scandir, and noticed iso9660's files d_type is always 0,
> > so here's a fix.
>
> No, it isn't.  DT_UNKNOWN is "I don't know; make no assumptions".
> DT_REG is "regular file".  Returning it when object in question is
> e.g. a symlink is wrong.

Right, then how about this partial fix:
--- c/fs/isofs/dir.c	2003-08-23 01:58:53.000000000 +0200
+++ a/fs/isofs/dir.c	2003-12-09 14:37:45.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_UNKNOWN) < 0)
 				break;
 		}
 		filp->f_pos += de_len;


Or maybe we should read inode->i_mode, if it's not too time expensive?


  reply	other threads:[~2003-12-09 13:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2003-12-09 16:28 ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312091445.12134.domen@coderock.org \
    --to=domen@coderock.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.