All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Curt Wohlgemuth <curtw@google.com>
Cc: Frank Mayhar <fmayhar@google.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] Make non-journal fsync work properly.
Date: Tue, 8 Sep 2009 17:41:21 -0400	[thread overview]
Message-ID: <20090908214121.GR22901@mit.edu> (raw)
In-Reply-To: <6601abe90909080757r23faeabbt7dcdfa3d5daf5985@mail.gmail.com>

On Tue, Sep 08, 2009 at 07:57:02AM -0700, Curt Wohlgemuth wrote:
> 
> I think we can take a look at this, but there are a lot of calls to
> ext4_handle_dirty_metadata(), and it's not clear on a quick inspection
> that we'd be able to determine which would need to be called with
> do_sync = 1...

Well, it's already the case that ext4_handle_dirty_metadata is a
#define:

#define ext4_handle_dirty_metadata(handle, inode, bh) \
	__ext4_handle_dirty_metadata(__func__, (handle), (inode), (bh))

So all we need to do is change it to be:

#define ext4_handle_dirty_metadata(handle, inode, bh) \
	__ext4_handle_dirty_metadata(__func__, (handle), (inode), (bh), 0)

#define ext4_handle_dirty_metadata_sync(handle, inode, bh) \
	__ext4_handle_dirty_metadata(__func__, (handle), (inode), (bh), 1)

And then add the extra function parameter to
__ext4_handle_dirty_metadata().  Hey, presto!  :-)

> On the other hand, this would take care of a similar problem that I
> was going to be sending a patch for this week: where removing an
> extent block without a journal requires a sync_dirty_buffer() in order
> to avoid writeback of the extent header in the block, *after* the
> block is marked free in the bitmap.

As I mentioned in the other message, the other thing we can do is to
use bforget(); that is more efficient than using sync_dirty_buffer(),
since it eliminates the write altogether.  Since the file has been
deleted, there's no point writing the dirty buffer out; simply using
bforget() to drop the dirty buffer is all that is necessary.

Regards,

						- Ted

  reply	other threads:[~2009-09-08 21:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-05  2:55 [PATCH] Make non-journal fsync work properly Frank Mayhar
2009-09-08  5:06 ` Theodore Tso
2009-09-08 14:57   ` Curt Wohlgemuth
2009-09-08 21:41     ` Theodore Tso [this message]
2009-09-08 15:41   ` Frank Mayhar
2009-09-08 22:05     ` Theodore Tso
2009-09-08 22:39       ` Frank Mayhar
2009-09-09 17:34       ` [PATCH] ext4: Make non-journal fsync work properly. REPOST Frank Mayhar
2009-09-10  2:55         ` Theodore Tso
2009-09-14 16:54         ` Aneesh Kumar K.V
2009-09-14 17:43           ` Frank Mayhar
2009-09-26  0:39         ` [PATCH] ext4: Make non-journal fsync work properly. (Version 3) Frank Mayhar
2009-09-29 14:09           ` Theodore Tso
2009-09-10  6:57 ` [PATCH] Make non-journal fsync work properly Aneesh Kumar K.V
2009-09-10 15:33   ` Frank Mayhar
2009-09-10 19:45     ` Theodore Tso

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=20090908214121.GR22901@mit.edu \
    --to=tytso@mit.edu \
    --cc=curtw@google.com \
    --cc=fmayhar@google.com \
    --cc=linux-ext4@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 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.