lkml.org 
[lkml]   [1999]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: swapon crashes computer
Guest section DW wrote:
> Maybe the cleanest patch would have set_blocksize return the original
> value, so that a failed swapon can restore the original state of affairs:

I've read the source code of set_blocksize(), and I think that
sys_swapon() must not call set_blocksize() if the device is in use:

set_blocksize() clears the buffer cache, and this will cause
problems if a filesystem is working with these buffers at the
same time. You do not even need an SMP computer:
set_blocksize() calls wait_on_buffer().

I remember that there was a thread a while ago that set_blocksize()
clears the contents of a ramdisk, and I'm sure that get/set_blocksize()
will cause problem if the computer is not idle.


I think we should add a "busy"-flag to blk_dev_struct.
- sys_swapon() tests and sets that flag
- sys_mount() tests and sets that flag
- sys_umount() clear that flag
- sys_swapoff() clears that flag
- the raid drivers should use that flag as well.

What do you think about this solution?
Is blk_dev_struct the correct structure, or should I add a new
array?

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