All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Mickler <florian@mickler.org>
To: linux-kernel@vger.kernel.org
Subject: Re: opendir() on a file???
Date: Tue, 9 Mar 2010 16:05:47 +0100	[thread overview]
Message-ID: <20100309160547.60641bc5@schatten.dmk.lab> (raw)
In-Reply-To: <1268126817.10479.643.camel@localhost>

On Tue, 09 Mar 2010 04:26:57 -0500
Jon Masters <jonathan@jonmasters.org> wrote:

> Folks,
> 
> Now I might be missing something, and I know I'm behind on LKML[0], but
> the following isn't supposed to work in my book:
> 
> /*
>  * Weird kernel test
>  */
> 
> #include <sys/types.h>
> #include <dirent.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>         DIR *dir;
> 
>         dir = opendir("foo.conf");
> 
>         if (dir)
>                 printf("WTF?\n");
> 
>         return 0;
> }
> 
> This is on an ext4 filesystem, whereas on a box with an older kernel
> this test correctly does not print "WTF?". I know some filesystems
> experiment with streams and treating files as directories, etc. but I
> wasn't aware that anything particular had changed recently?
> 
> The box is running almost an upstream kernel, and I can poke if I'm told
> this not intended: 2.6.34-0.8.rc0.git11.fc14.x86_64.
> 
> What am I missing?
> 
> Jon.
> 
> [0] The podcast isn't dead, I'm just suffering from a cold and will be
> taking a day off to recover and catch up with that sometime today.
> 
> 

perhaps you are missing this patch: 
commit 781b16775ba0bb55fac0e1757bf0bd87c8879632
Author: Al Viro <viro@ZenIV.linux.org.uk>
Date:   Sat Mar 6 18:41:07 2010 +0000

    Fix a dumb typo - use of & instead of &&
    
    We managed to lose O_DIRECTORY testing due to a stupid typo in commit
    1f36f774b2 ("Switch !O_CREAT case to use of do_last()")
    
    Reported-by: Walter Sheets <w41ter@gmail.com>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


but this is only a guess...

cheers,
Flo



      parent reply	other threads:[~2010-03-09 17:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09  9:26 opendir() on a file??? Jon Masters
2010-03-09 14:59 ` Ulrich Drepper
2010-03-09 16:05   ` Jon Masters
2010-03-09 15:05 ` Florian Mickler [this message]

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=20100309160547.60641bc5@schatten.dmk.lab \
    --to=florian@mickler.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.