linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Nick Piggin <npiggin@kernel.dk>, linux-fsdevel@vger.kernel.org
Subject: Re: [patch 2/4] fs: fsync inode dirty race fix
Date: Tue, 23 Nov 2010 00:43:15 +1100	[thread overview]
Message-ID: <AANLkTinFX8XRoUS8ebnaG4zY8-sykVdmWR1mL4DosJyG@mail.gmail.com> (raw)
In-Reply-To: <20101122132318.GB25321@infradead.org>

On Tue, Nov 23, 2010 at 12:23 AM, Christoph Hellwig <hch@infradead.org> wrote:
>>       ret = sync_mapping_buffers(inode->i_mapping);
>> -     if (!(inode->i_state & I_DIRTY))
>> -             return ret;
>> -     if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
>> -             return ret;
>> -
>>
>>       err = sync_inode_metadata(inode, 1);
>
> This makes fdatasync equivalent to fsync, which means a huge drop
> in performance for database an virtualization performance.
>
> I think the right aproach is to extend the sync_inode_metadata to
> writeback_single_inode chain with a datasync parameter so that we
> can do the correct decision there.

I was leaning towards using the new inode writeback helpers, then
filesystems should use them to check inode dirty state without races.

You could still move datasync into the writeback function, but it
wouldn't be a requirement. More complex filesystem schemes seem
to need to actually test these flags.

> Note that there are a lot more fsync implementations than just
> generic_file_fsync and exofs_fsync that have the same issue.

Yes, they require patch 3/4, and a lot more testing than I had time
to do tonight. I'll send out some patches tomorrow.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-11-22 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 13:05 [patch 1/4] fs: mark_inode_dirty barrier fix Nick Piggin
2010-11-22 13:06 ` [patch 2/4] fs: fsync inode dirty race fix Nick Piggin
2010-11-22 13:23   ` Christoph Hellwig
2010-11-22 13:43     ` Nick Piggin [this message]
2010-11-22 13:07 ` [patch 3/4] fs: introduce inode dirty state helpers Nick Piggin
2010-11-22 13:25   ` Christoph Hellwig
2010-11-22 13:44     ` Nick Piggin
2010-11-22 13:09 ` [patch 4/4] ext2: inode sync fixes Nick Piggin
2010-11-22 13:16 ` [patch 1/4] fs: mark_inode_dirty barrier fix 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=AANLkTinFX8XRoUS8ebnaG4zY8-sykVdmWR1mL4DosJyG@mail.gmail.com \
    --to=npiggin@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    /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).