bug-hurd
[Top][All Lists]
Advanced

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

Re: Annoying free inode warnings


From: Marcus Brinkmann
Subject: Re: Annoying free inode warnings
Date: Fri, 17 Aug 2001 02:17:19 +0200
User-agent: Mutt/1.3.20i

On Thu, Aug 16, 2001 at 06:46:34PM -0400, Roland McGrath wrote:
> > So we should remove the warnings.  Should we also remove the zeroing of the
> > block count when we delete a file?
> 
> I don't see a reason to behave differently from Linux on this, so yes.

It seems to happen implicitely in write_node.
According to diskfs_drop_node, st_mode is set to zero when the node is going
to be free'd.  So, we can avoid updating the node under this condition.
The purpose is to make it easier to recover a file the hard way (this is
unsupported and unreliable, but it saved my life on a number of occasions).

So I would say that we can change in write_node:

      di->i_size = st->st_size;

...

      di->i_blocks = st->st_blocks;

...

      /* Set dtime non-zero to indicate a deleted file.  */
      di->i_dtime = (st->st_mode ? 0 : di->i_mtime);

to

  /* Set dtime non-zero to indicate a deleted file, but don't
     update the size fields.  */
  if (st->st_mode)
    {
      di->i_size = st->st_size;
      di->i_blocks = st->st_blocks;
      di->i_dtime = 0;
    }
  else
    di->i_dtime = di->i_mtime;

Does this look about right?

Also, in diskfs_dirremove_hard, the instruction

  dp->dn_set_mtime = 1;

occurs twice at the same level in diskfs_dirremove_hard.   This seems to e
redundant.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

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