[lkml]   [2000]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: apm bug?
Hi Amos,

1. I cannot answer immediately.

2. I think this is standard unix behaviour, it is certainly possible in
DG/UX to delete a file when another process is accessing it, and it will do
it without a wimper.

Now, if you're a granny expert at sucking eggs, then I apologise for what
follows, not to say I'm a granny (I'm not even a grandad):

What is happening? The file as you see it is an entry in a directory, but
that is not the file - it is merely a name/inode pointer pair. The inode
pointer is the "link" to the files inode (the inode contains all the
information about the file aside from the name: size, where it's located on
disk, access time...).

When a process makes a call to "open" the file it gets a link (just like the
"link" in the directory) to the inode (this is a bit woolly, but basically
true, I think). The inode has a reference count field which tallies the
number of links to it.

When is the file deleted? when the reference count goes to zero!

So you did not delete the file, you only removed the link from the directory
to the inode. However, when the process closes the file, to all intents and
purposes you have lost access to it (unless of course you can reconstruct
the inode pointer).

Question to the disk driver developers: Am I right? Does closing the files
remove the link and thus decrement the reference count? What happens to the
space mapped by the inode?


----- Original Message -----
From: amos <>
To: Derrick Steed <>
Sent: Tuesday, February 08, 2000 2:58 AM
Subject: Re: apm bug?

> On Sat, 05 Feb 2000, you wrote:
> > There is a patch
> > May be wrong, but hope it helps anyway.
> Thanks, it helped alot.
> Therefore, you have been chosen (...) to answer some other questions I
> (hope you don't mind) :
> 1. (this arised while trying to install the patched linux kernel -
> the computer got stuck saying no coprocessor found and no math
> emulation, giving up. Apparently the no_hlt and no387 in lilo.conf I
> there in order to try and see if it has something to do with APM
> (in the unpatched kernels) caused it to hang. Running lilo from almost
> bootdisks I have didn't help, it said something about missing LILO
> in the boot sector, which wasn't true - I guess lilo v0.19 and 0.20
has some
> bugs), so the question is how do I mount my HD after running
> disks so I can execute things from there - mounting it works fine but
> to execute ANYTHING from there fails, even after adding the binary
> to PATH, or copying the wanted file to the boot disks filesystem.
> Chmod/chown doesn't help either. The shell either prompts me that 'no
> command' (even though it exists).
> This is weird because neither the bootdisk filesystem nor the HD was
> mounted as read only or noexec.
> btw : I've finally found a boot disk with lilo 0.21, and the new
> works fine (after removing the no386 and nohlt). APM now works.
> 2. In general - It seems that I can delete files that
> are accessed in other processes at the same time. Is there an
> that will warn me before doing so?
> More questions might follow...
> Thanks,
> Amos

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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