lkml.org 
[lkml]   [1999]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjecti_size still not SMP safe.
Date
I read that Linus wants to issue a feature freeze soon, so I want to remind
the VFS developers that (AFAIK) i_size and file->f_pos are not yet SMP safe
(I posted this a few weeks ago for 2.3.6)

Description (everything for ext2):
sys_write() calls generic_file_write() without acquiring the big kernel
lock, and generic_file_write() uses f_pos and i_size without any locks.
Note that O_APPEND is broken as well, and this might be the larger problem.

My only idea is quite ugly, so I hope someone has a better solution:
2 new fields in every inode: a linked list (contains all operations
currently executing on the inode) and a wait queue (for all
collisions).

Note that currently do_truncate() acquires inode->i_sem before calling
i_op->truncate, but I don't see why. (sys_open(O_TRUNC) truncates
a file, but it doesn't acquire the inode semaphore.)

Btw, I think that the lock_kernel()-call in sys_lseek() is superflous:
sys_lseek accesses the same fields as sys_write(), but sys_write()
does not acquire the big kernel lock.

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:53    [W:0.191 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site