FIOASYNC is (really!) broken in 2.2.1 (fwd)

Godmar Back (gback@cs.utah.edu)
Mon, 8 Mar 1999 14:06:55 -0700 (MST)


Hi, here's a msg concerning a bug in FIOASYNC that I had sent to
Linus & Alan; I think it may be of interest to this list as well.
I checked 2.2.2, and it's still broken.

Now that O_SYNC is apparently implemented, it would be nice if you
guys fixed this: this way, I won't have to code around it for future
Linux versions (although it probably won't make much of a difference:
given the huge legacy of installed pre 2.2.3 Linux boxes, I have to code
around it anyway.) But for new ports/applications it will be important.

Plus, I wouldn't be surprised if some applications suddenly changed
their behavior, which is what happened to me with Kaffe (www.kaffe.org)
(You'll notice if your app suddenly starts to write synchronously to your
local disk.)

Note that I'm not subscribed to the linux-kernel mailing list;
if you want me to see replies, cc me.

Cheers,

- Godmar

Forwarded message:
> From gback@marker.cs.utah.edu Fri Mar 5 10:43:48 1999
> From: Godmar Back <gback@marker.cs.utah.edu>
> Message-Id: <199903051743.KAA03674@marker.cs.utah.edu>
> Subject: FIOASYNC is (really!) broken in 2.2.1
> To: torvalds@transmeta.com, alan@lxorguk.ukuu.org.uk
> Date: Fri, 5 Mar 1999 10:43:29 -0700 (MST)
> Cc: gback@marker.cs.utah.edu (Godmar Back)
> X-Mailer: ELM [version 2.4ME+ PL40 (25)]
> MIME-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
>
>
> Hi guys,
>
> I don't have the time to fix this myself, but there's a glaring bug
> in the ioctl.c code wrt FIOASYNC.
>
> What happens is that Linux interprets request to enable asynchronous
> IO on a filedescriptor as requests to write to the file synchronously.
> Please don't laugh.
>
> This has the side-effect that an application that finishes
> instantaneously on FreeBSD takes 1 minute on Linux. I hit this
> problem in Kaffe (www.kaffe.org).
>
> This code in question is in fs/ioctl.c:
>
> case FIOASYNC: /* O_SYNC is not yet implemented,
> but it's here for completeness. */
> if ((error = get_user(on, (int *)arg)) != 0)
> break;
> if (on)
> filp->f_flags |= O_SYNC;
> else
> filp->f_flags &= ~O_SYNC;
> break;
>
> What you really want to do is to treat FIOASYNC like a FASYNC fcntl.
>
> I also suppose you want to fix the comment above since O_SYNC appears
> to be implemented now.
>
> Thanks, and keep up the good work.
> I apologize if that's already fixed (I'm using 2.2.1).
>
> - Godmar
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/