Re: sys_write() racy for multi-threaded append?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <alan@...>, <7eggert@...>, <dada1@...>, <linux-kernel@...>
Date: Tuesday, March 13, 2007 - 1:59 pm

Clearly f_pos atomicity has been handled differently in the not-so-distant past:

http://www.mail-archive.com/linux-fsdevel@vger.kernel.org/msg01628.html

And equally clearly the current generic_file_llseek semantics are
erroneous for large offsets, and we shouldn't be taking the inode
mutex in any case other than SEEK_END:

http://marc.theaimsgroup.com/?l=linux-fsdevel&m=100584441922835&w=2

read_write.c is a perfect example of the relative amateurishness of
parts of the Linux kernel.  It has probably gone through a dozen major
refactorings in fifteen years but has never acquired a "theory of
operations" section justifying the errors returned in terms of
standards and common usage patterns.  It doesn't have assertion-style
precondition/postcondition checks.  It's full of bare constants and
open-coded flag tests.  It exposes sys_* and vfs_* and generic_file_*
without any indication of which sanity checks you're bypassing when
you call the inner functions directly.  It leaks performance right and
left with missing likely() macros and function calls that can't be
inlined because there's no interface/implementation split.  And then
you want to tell me that it costs too much to spinlock around f_pos
updates when file->f_count > 1?  Give me a break.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: sys_write() racy for multi-threaded append?, Bodo Eggert, (Mon Mar 12, 3:53 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Mon Mar 12, 12:26 pm)
Re: sys_write() racy for multi-threaded append?, Bodo Eggert, (Mon Mar 12, 2:48 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Mon Mar 12, 8:46 pm)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Mon Mar 12, 10:24 pm)
Re: sys_write() racy for multi-threaded append?, David M. Lloyd, (Tue Mar 13, 10:00 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 3:25 am)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Tue Mar 13, 9:15 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Wed Mar 14, 4:09 pm)
Re: sys_write() racy for multi-threaded append?, Frank Ch. Eigler, (Fri Mar 16, 12:43 pm)
Re: sys_write() racy for multi-threaded append?, Alan Cox, (Fri Mar 16, 1:25 pm)
Re: sys_write() racy for multi-threaded append?, David Miller, (Tue Mar 13, 3:42 am)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 12:24 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 1:59 pm)
Re: sys_write() racy for multi-threaded append?, Christoph Hellwig, (Tue Mar 13, 3:09 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 7:40 pm)
Re: sys_write() racy for multi-threaded append?, Michael K. Edwards, (Tue Mar 13, 8:09 pm)