diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-02-02 06:06:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-02 06:06:42 -0800 |
| commit | 7619fd2bb706279edf839d8caa8a80e63bb93b7a (patch) | |
| tree | d9ccee1dbe2a8b8f92fc88adb0040f988639717a /kernel | |
| parent | 7c0f82da343024b1ac260c8e2ee458464eb19de4 (diff) | |
[PATCH] Fix inode size accounting race
Since Jan removed the lock_kernel()s in inode_add_bytes() and
inode_sub_bytes(), these functions have been racy.
One problematic workload has been discovered in which concurrent writepage
and truncate on SMP quickly causes i_blocks to go negative. writepage() does
not take i_sem, and it seems that for ext2, there are no other locks in
force when inode_add_bytes() is called.
Putting the BKL back in there is not acceptable. To fix this race I have
added a new spinlock "i_lock" to the inode.
That lock is presently used to protect i_bytes and i_blocks. We could use it
to protect i_size as well.
The splitting of the used disk space into i_blocks and i_bytes is silly - we
should nuke all that and just have a bare loff_t i_usedbytes. Later.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/ksyms.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 574addf5af63..d6f67455a7fe 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -272,6 +272,10 @@ EXPORT_SYMBOL(vfs_fstat); EXPORT_SYMBOL(vfs_stat); EXPORT_SYMBOL(vfs_lstat); EXPORT_SYMBOL(vfs_getattr); +EXPORT_SYMBOL(inode_add_bytes); +EXPORT_SYMBOL(inode_sub_bytes); +EXPORT_SYMBOL(inode_get_bytes); +EXPORT_SYMBOL(inode_set_bytes); EXPORT_SYMBOL(lock_rename); EXPORT_SYMBOL(unlock_rename); EXPORT_SYMBOL(generic_read_dir); |
