Re: Does linux locks swap file?

H. Peter Anvin (
30 Jan 1997 04:14:47 GMT

Followup to: <>
By author: Boris Tobotras <>
In newsgroup:
> Hello.
> If I've understood sys_swapon() correctly, there is no increment
> of inode's usage counter if swapping goes to regular file. If this
> assumption is correct, it is definitely a bug. If it is wrong, please
> tell me why :)
> This was inspired by report of someone who was able to crash
> system just by removing active swap file.

That's definitely a bug. IMNSHO a swapon() should be treated the same
way as an open() from this standpoint. It may also be a good idea
(although I don't know about this one, really) to record a lock on all
bytes in the file.


This space intentionally has nothing but text explaining why this
space has nothing but text explaining that this space would otherwise
have been left blank, and would otherwise have been left blank.