All of lore.kernel.org
 help / color / mirror / Atom feed
* opendir() on a file???
@ 2010-03-09  9:26 Jon Masters
  2010-03-09 14:59 ` Ulrich Drepper
  2010-03-09 15:05 ` Florian Mickler
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Masters @ 2010-03-09  9:26 UTC (permalink / raw)
  To: LKML

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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: opendir() on a file???
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Ulrich Drepper @ 2010-03-09 14:59 UTC (permalink / raw)
  To: Jon Masters; +Cc: LKML

On Tue, Mar 9, 2010 at 01:26, Jon Masters <jonathan@jonmasters.org> wrote:
> 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:

Al introduced and fixed the problem, from what I've seen.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: opendir() on a file???
  2010-03-09  9:26 opendir() on a file??? Jon Masters
  2010-03-09 14:59 ` Ulrich Drepper
@ 2010-03-09 15:05 ` Florian Mickler
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Mickler @ 2010-03-09 15:05 UTC (permalink / raw)
  To: linux-kernel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: opendir() on a file???
  2010-03-09 14:59 ` Ulrich Drepper
@ 2010-03-09 16:05   ` Jon Masters
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Masters @ 2010-03-09 16:05 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: LKML

On Tue, 2010-03-09 at 06:59 -0800, Ulrich Drepper wrote:
> On Tue, Mar 9, 2010 at 01:26, Jon Masters <jonathan@jonmasters.org> wrote:
> > 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:
> 
> Al introduced and fixed the problem, from what I've seen.

Thanks. It's fixed in today's rawhide.

Jon.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-09 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.