From: Christoph Hellwig <hch@infradead.org>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-fsdevel@vger.kernel.org, jens.axboe@oracle.com,
chris.mason@oracle.com
Subject: Re: [PATCH] writeback: Update dirty flags in two steps
Date: Fri, 7 May 2010 08:23:27 -0400 [thread overview]
Message-ID: <20100507122327.GA27458@infradead.org> (raw)
In-Reply-To: <877hngf40f.fsf@openvz.org>
On Fri, May 07, 2010 at 01:35:44PM +0400, Dmitry Monakhov wrote:
>
> Filesystems with delalloc support may dirty inode during writepages.
> As result inode will have dirty metadata flags even after write_inode.
> In fact we have two dedicated functions for proper data and metadata
> writeback. It is reasonable to separate flags updates in two stages.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=15906
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Looks good and passes XFSQA for me.
Reviewed-by: Christoph Hellwig <hch@lst.de>
> + spin_lock(&inode_lock);
> + dirty = inode->i_state & I_DIRTY;
> + inode->i_state &= ~(I_DIRTY_SYNC | I_DIRTY_DATASYNC);
> + spin_unlock(&inode_lock);
> /* Don't write the inode if only I_DIRTY_PAGES was set */
> if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
No need for the double masking, the first line could be just
dirty = inode->i_state;
or you could do:
/* Don't write the inode if only I_DIRTY_PAGES was set */
dirty = inode->i_state & (I_DIRTY_SYNC | I_DIRTY_DATASYNC);
and then just
if (dirty) {
prev parent reply other threads:[~2010-05-07 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 9:35 [PATCH] writeback: Update dirty flags in two steps Dmitry Monakhov
2010-05-07 12:23 ` Christoph Hellwig [this message]
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=20100507122327.GA27458@infradead.org \
--to=hch@infradead.org \
--cc=chris.mason@oracle.com \
--cc=dmonakhov@openvz.org \
--cc=jens.axboe@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
/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).