lkml.org 
[lkml]   [1999]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: swapon crashes computer
> 
> 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?
There is another solution... You can check whether the device is mounted via lookup_vfsmnt() and the check
for swap could be done in the similar way (I'm not much aware of swap code but it is possible). So you can
make some call like device_busy() and use it instead another field. But I agree this solution is much slower
and we should be aware of races.

Honza.


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