lkml.org 
[lkml]   [1999]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.3.7: generic_write_page(): O_APPEND & inode->i_size not SMP safe
Date
I cc'ed Alexander, because I think this is mostly a
VFS SMP problem.

Ingo wrote:
> > >2) setting inode->i_size is not SMP safe.
>
> Your fix looks good
I'm not sure:
think about 2 processes with O_APPEND:
they still write to the same address, if this is a log file,
then 1 log record will be lost.

> note that Alexander Viro is
> working on SMP-threading the VFS, which will change those places that
> update filep fields.]

I think that the file pointer and the actual write operation
must be coherent (i.e. if two threads write data with the same filp,
then they must write to different addresses; and if a write operation
is aborted in the middle, then we must handle that gracefully
[no data leak with uninitialized memory, can we advance
the file pointer even if the data bytes were never
written?]).

Note that with O_APPEND, inode->i_size replaces the file pointer
for write operation, so cannot implement a lazy inode->i_size
update (i.e. writing and updating i_size when we obtain
the kernel lock).

I'll wait for the patch from Alexander.
--
Manfred




-
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.195 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site