Re: FW: Linux kernel file offset pointer races

From: Linus Torvalds
Date: Mon Aug 09 2004 - 12:26:54 EST




On Mon, 9 Aug 2004, Jonathan Corbet wrote:
>
> This (along with the bits which have just gone into BK) hints at a
> driver API change. Inquiring minds are *very* curious about such things
> at the moment... will there be a file_operations method prototype
> change associated with the file offset fixes?

No, it's all just building up to the kernel internally always using a
pread/pwrite-like thing to the drivers, and then maintaining f_pos
entirely in the VFS layer. All the VFS interfaces do this already (since
that is how the user-visible pread/pwrite works).

But a few drivers are buggy (they access f_pos directly even if it was a
user-level pread/pwrite), and in particular the /proc sysctl interface was
totally broken this way.

So I've fixed the sysctl code - that _did_ require a prototype change, but
wasn't horribly painful, and am going through drivers..

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