From: Christoph Hellwig <hch@infradead.org>
To: Miklos Szeredi <mszeredi@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>,
Miklos Szeredi <miklos@szeredi.hu>,
viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, jack@suse.cz,
akpm@linux-foundation.org, toshi.okajima@jp.fujitsu.com
Subject: Re: [PATCH 12/13] vfs: count unlinked inodes
Date: Fri, 28 Oct 2011 04:04:45 -0400 [thread overview]
Message-ID: <20111028080445.GA10318@infradead.org> (raw)
In-Reply-To: <1319788433.13842.8.camel@tucsk.pomaz.szeredi.hu>
On Fri, Oct 28, 2011 at 09:53:53AM +0200, Miklos Szeredi wrote:
> On Fri, 2011-10-28 at 02:08 -0400, Christoph Hellwig wrote:
> > This one gets me a repeated spew of WARN_ONs during XFS log recover,
> > repeating the following pattern:
>
> The assumption here is that set_nlink() is called with a non-zero count.
> The point of introducing set_nlink() was to verify this assumption,
> otherwise pending delete accounting will be screwed up.
>
> If setting i_nlink to zero is not a bug in xfs we can do two things:
>
> 1) do a conditional clear_nlink() in xfs_setup_inode() to document that
> nlink can indeed be zero
>
> 2) remove the warning from set_nlink(). That may hide some cases where
> i_nlink was cleared without the intention of the filesystem but it will
> work just fine wrt. the pending delete accounting.
I suspect 2 might be the better option. The pattern we see here in
XFS is pretty typical for transactional filesytems - when we mount a
filesystem after an unclean shutdown we need to drop all inodes that
were open but unlinked when the system crashed, and that typically
means reading inodes from disk that have a zero i_nlink. Maybe some
filesystems never instanciate a VFS inode for it, but I suspect many
do.
For XFS we will actually see it during regularly testing as we have
an ioctl that simulates a shutdown and can thus trigger log recovery
easily, while for others like ext4 you'd actually have to do a real
reset of your (physical or virtual) machine.
next prev parent reply other threads:[~2011-10-28 8:04 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 14:48 [PATCH 0/13] read-only remount race fix v7 Miklos Szeredi
2011-10-12 14:48 ` [PATCH 01/13] vfs: ignore error on forced remount Miklos Szeredi
2011-10-12 14:48 ` [PATCH 02/13] vfs: keep list of mounts for each superblock Miklos Szeredi
2011-10-12 14:48 ` [PATCH 03/13] vfs: protect remounting superblock read-only Miklos Szeredi
2011-10-12 14:48 ` [PATCH 04/13] vfs: fs_may_remount_ro: turn unnecessary check into a WARN_ON Miklos Szeredi
2011-10-12 14:48 ` [PATCH 05/13] hypfs: remove unnecessary nlink setting Miklos Szeredi
2011-10-12 14:48 ` [PATCH 06/13] jfs: " Miklos Szeredi
2011-10-12 15:26 ` Dave Kleikamp
2011-10-12 14:49 ` [PATCH 07/13] ocfs2: " Miklos Szeredi
2011-10-12 14:49 ` [PATCH 08/13] logfs: " Miklos Szeredi
2011-10-12 14:49 ` [PATCH 09/13] filesystems: add missing nlink wrappers Miklos Szeredi
2011-10-12 14:49 ` [PATCH 10/13] filesystems: add set_nlink() Miklos Szeredi
2011-10-13 16:33 ` Steven Whitehouse
2011-10-14 15:04 ` Miklos Szeredi
2011-10-12 14:49 ` [PATCH 11/13] vfs: protect i_nlink Miklos Szeredi
2011-10-12 14:49 ` [PATCH 12/13] vfs: count unlinked inodes Miklos Szeredi
2011-10-28 6:08 ` Christoph Hellwig
2011-10-28 7:53 ` Miklos Szeredi
2011-10-28 8:04 ` Christoph Hellwig [this message]
2011-10-28 8:20 ` Miklos Szeredi
2011-10-28 8:29 ` Christoph Hellwig
2011-10-12 14:49 ` [PATCH 13/13] vfs: prevent remount read-only if pending removes Miklos Szeredi
2011-10-12 15:03 ` [PATCH 0/13] read-only remount race fix v7 Christoph Hellwig
2011-10-12 15:09 ` Miklos Szeredi
2011-10-13 7:10 ` Toshiyuki Okajima
2011-10-18 6:28 ` Toshiyuki Okajima
2011-10-18 9:02 ` Miklos Szeredi
-- strict thread matches above, loose matches on Subject: below --
2011-10-28 12:13 [PATCH 00/13] read-only remount race fix v9 Miklos Szeredi
2011-10-28 12:13 ` [PATCH 12/13] vfs: count unlinked inodes Miklos Szeredi
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=20111028080445.GA10318@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@suse.cz \
--cc=toshi.okajima@jp.fujitsu.com \
--cc=viro@ZenIV.linux.org.uk \
/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.