bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tmpfs: now working


From: Neal H Walfield
Subject: Re: [PATCH] tmpfs: now working
Date: Tue, 1 May 2001 17:49:53 +0200
User-agent: Mutt/1.3.15i

> >     (diskfs_truncate): We can truncate objects when they are being
> >     truncated to a size of zero.  
> 
> Nope.  That was my first thought too--when I wrote that code in the first
> place, it looked exactly like yours--but on further consideration I
> realized it won't do.

Well, we have to do something, otherwise, when diskfs_drop_node is
called, will trigger an assert.

Consider the following:  when diskfs_drop_node is called, if there is
space allocated, it adds a reference and attempts to truncate the file
to zero and happens to sets np->allocsize to 0.  diskfs_drop_node then
drops its reference causing it to, eventually, restart.  This time,
since np->allocsize is 0 it does not try to truncate the file, however,
it asserts that the file size is zero.

Therefore, we either need to kill the assert or pretend the truncate
actually happens in diskfs_truncate and set np->dn_stat.st_size to zero.
The latter is not actually a bad solution as a process can always map in
however much it wants anyway once it has a memory object port.  We
cannot, however, set dn->allocsize to dn->dn_stat.st_size or we will end
up in an infinite loop.

Attachment: pgpYgPAz5BmuF.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]