All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: iget behaviour in xlog_recover_process_iunlinks
Date: Fri, 11 Apr 2008 12:14:47 +1000	[thread overview]
Message-ID: <47FEC997.5060506@sgi.com> (raw)
In-Reply-To: <20080410190453.GA8083@lst.de>

Christoph Hellwig wrote:
> shouldn't we call xfs_iget with the XFS_IGET_CREATE flag here?
> 
> the code seems to be perfectly happy with zero-ed out inodes as long as
> di_next_unlinked is valid.
> 


So looking at this code...

we look at each bucket in the AGI bucket list and
walk the di_next_unlinked list of inodes.
We do an xfs_iget with 0 for flags which will mean
in xfs_iget_core it will error
out if it finds an inode with zeroed mode
(which happens on inodes which have been zeroed b/c it is new
or inativated with the mode reset in xfs_ifree,
however, it wouldn't all be zeroed as di_next_unlinked is
non zero).

And yet in the xlog_recover_process_iunlinks() it
later checks for a zero mode or not.
>  if (ip->i_d.di_mode == 0)
>          xfs_iput_new(ip, 0);
>  else
>          IRELE(ip);
....
> void
> xfs_iput_new(xfs_inode_t        *ip,
>              uint               lock_flags)
> {
>         struct inode    *inode = ip->i_vnode;
> 
>         xfs_itrace_entry(ip);
> 
>         if ((ip->i_d.di_mode == 0)) {
>                 ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE));
>                 make_bad_inode(inode);
>         }
>         if (inode->i_state & I_NEW)
>                 unlock_new_inode(inode);
>         if (lock_flags)
>                 xfs_iunlock(ip, lock_flags);
>         IRELE(ip);
> }

And if it does get an error from xfs_iget, it will ditch
the rest of the list and the bucket.

So yeah to me it looks like we need XFS_IGET_CREATE or we
have handling code for zero mode which never happens or
we are risking ditching some unlinked inodes.

Was that what you were noticing?

--Tim

  reply	other threads:[~2008-04-11  2:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 19:04 iget behaviour in xlog_recover_process_iunlinks Christoph Hellwig
2008-04-11  2:14 ` Timothy Shimmin [this message]
2008-04-11  2:44 ` David Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FEC997.5060506@sgi.com \
    --to=tes@sgi.com \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.