lkml.org 
[lkml]   [1997]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Does linux locks swap file?
Date
Ion Badulescu wrote:
>
>
> On 30 Jan 1997, H. Peter Anvin wrote:
>
> > That's definitely a bug. IMNSHO a swapon() should be treated the same
> > way as an open() from this standpoint.
>
> It's not a bug, swapon() does increment the inode usage counter of the
> swapfile.

So the file sticks around until the last time its closed, even though
no directory entry points to it. That's fine and dandy - that's the way
it should be, but if its true then how come somebody claimed that removing
the swap file crashed the system :-(

> > 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.
>
> It might be. Although, if it's just an advisory lock... it's kind of
> useless.

A mandatory lock would be pretty useless too if we're talking about
deleting the swap file. The mandatory lock will stop other processes
from opening the file and scribbling in our swap space, but will do
nothing to guard against deletion.

-Andy


--
Andy Walker Kvaerner Engineering a.s.
Andrew.Walker@lysaker.kvaerner.no P.O. Box 222, N-1324 Lysaker, Norway

......if the answer isn't violence, neither is your silence......

(pwei barmy army - oslo "filial")

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.087 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site