From: Christoph Hellwig <hch@infradead.org>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org
Subject: invalidate_inode_buffers call in invalidate_list?
Date: Sun, 17 Oct 2010 19:39:00 -0400 [thread overview]
Message-ID: <20101017233900.GA1525@infradead.org> (raw)
Does anyone remember why we call invalidate_inode_buffers in
invalidate_list? These days we basically call invalidate_inode_buffers
only in ->evict_inode, which we will call from invalidate_list in
case of a zero refcount.
For calls to invalidate_inode_buffers it's hamrless, but for other
callers it means we lose track of which buffers were dirtied for
an inode, and thus can write them out during fsync.
Something like the untested patch below should fix it. While we're
at it - any reaso not to consider I_NEW inodes as busy in
invalidate_list?
Index: linux-2.6/fs/inode.c
===================================================================
--- linux-2.6.orig/fs/inode.c 2010-10-17 16:33:34.826254213 -0700
+++ linux-2.6/fs/inode.c 2010-10-17 16:34:40.407003969 -0700
@@ -570,18 +570,16 @@ static int invalidate_list(struct super_
spin_unlock(&inode->i_lock);
continue;
}
- invalidate_inode_buffers(inode);
- if (!inode->i_ref) {
- WARN_ON(inode->i_state & I_NEW);
- inode->i_state |= I_FREEING;
+ if (inode->i_ref) {
spin_unlock(&inode->i_lock);
-
- /* save a lock round trip by removing the inode here. */
- list_move(&inode->i_sb_list, dispose);
+ busy = 1;
continue;
}
+ inode->i_state |= I_FREEING;
spin_unlock(&inode->i_lock);
- busy = 1;
+
+ /* save a lock round trip by removing the inode here. */
+ list_move(&inode->i_sb_list, dispose);
}
return busy;
}
next reply other threads:[~2010-10-17 23:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-17 23:39 Christoph Hellwig [this message]
2010-10-18 1:11 ` invalidate_inode_buffers call in invalidate_list? Dave Chinner
2010-10-18 2:18 ` Christoph Hellwig
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=20101017233900.GA1525@infradead.org \
--to=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).