mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] fat: Fix VFAT_IOCTL_READDIR_xxx and cleanup for userland
Date: Tue, 1 Jul 2008 14:22:48 +0300	[thread overview]
Message-ID: <20080701112248.GA17558@cs181140183.pp.htv.fi> (raw)
In-Reply-To: <20080701074033.GB30362@infradead.org>

On Tue, Jul 01, 2008 at 03:40:33AM -0400, Christoph Hellwig wrote:
> On Tue, Jul 01, 2008 at 11:57:03AM +0900, OGAWA Hirofumi wrote:
> > 
> > "struct dirent" is a kernel type here, but is a **different type** in 
> > userspace!  This means both the structure and the IOCTL number is wrong!
> > 
> > So, this adds new "struct __fat_dirent" to generate correct IOCTL
> > number.  And kernel stuff moves to under __KERNEL__.
> 
> Given that the current version can't actually work without defininig
> it's own dirent and thus ioctl number symbolic name I wonder if these
> ioctls are used at all?  They must have been completely untested for
> a while, and I suspect we'd be better off just removing them.

I had the same thought, but when checking this I noticed that at least 
wine works around this problem:

<--  snip  -->

/* just in case... */
#undef VFAT_IOCTL_READDIR_BOTH
#undef USE_GETDENTS

#ifdef linux

/* We want the real kernel dirent structure, not the libc one */
typedef struct
{
    long d_ino;
    long d_off;
    unsigned short d_reclen;
    char d_name[256];
} KERNEL_DIRENT;

/* Define the VFAT ioctl to get both short and long file names */
#define VFAT_IOCTL_READDIR_BOTH  _IOR('r', 1, KERNEL_DIRENT [2] )

<--  snip  -->


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  parent reply	other threads:[~2008-07-01 11:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  2:57 [PATCH 1/7] fat: Fix parse_options() OGAWA Hirofumi
2008-07-01  2:57 ` [PATCH 2/7] fat: Fix VFAT_IOCTL_READDIR_xxx and cleanup for userland OGAWA Hirofumi
2008-07-01  2:57   ` [PATCH 3/7] fat/dir.c: switch to struct __fat_dirent OGAWA Hirofumi
2008-07-01  2:57     ` [PATCH 4/7] fat: cleanup fs/fat/dir.c OGAWA Hirofumi
2008-07-01  2:57       ` [PATCH 5/7] fat: use same logic in fat_search_long() and __fat_readdir() OGAWA Hirofumi
2008-07-01  2:57         ` [PATCH 6/7] fat: small optimaize __fat_readdir() OGAWA Hirofumi
2008-07-01  2:57           ` [PATCH 7/7] Fix the case of jiffies wrapping in mm/pdflush.c OGAWA Hirofumi
2008-07-01  3:34             ` Andrew Morton
2008-07-01  4:05               ` OGAWA Hirofumi
2008-07-01 12:22       ` [PATCH 4/7] fat: cleanup fs/fat/dir.c Christoph Hellwig
2008-07-01 14:16         ` OGAWA Hirofumi
2008-07-01  3:32     ` [PATCH 3/7] fat/dir.c: switch to struct __fat_dirent Andrew Morton
2008-07-01  3:54       ` OGAWA Hirofumi
2008-07-01  7:40   ` [PATCH 2/7] fat: Fix VFAT_IOCTL_READDIR_xxx and cleanup for userland Christoph Hellwig
2008-07-01  8:33     ` OGAWA Hirofumi
2008-07-01 11:22     ` Adrian Bunk [this message]
2008-07-01 12:18       ` Christoph Hellwig
2008-07-01 12:20   ` Christoph Hellwig
2008-07-01 13:15     ` OGAWA Hirofumi

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=20080701112248.GA17558@cs181140183.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®