linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 4/7] ext4: refactor punch hole code
Date: Tue, 26 Mar 2013 22:38:16 -0400	[thread overview]
Message-ID: <20130327023816.GC2697@thunk.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1303261334060.2455@(none)>

On Tue, Mar 26, 2013 at 01:54:19PM +0100, Lukáš Czerner wrote:
> > +	/* Wait all existing dio workers, newcomers will block on i_mutex */
> > +	ext4_inode_block_unlocked_dio(inode);
> 
> This was not present in the indirect punch hole code, does it means
> that there was a bug ? If so maybe it's worth mentioning in the
> description? 

Yes, I'm pretty sure it was a bug.  The
ext4_inode_block_unlocked_dio() call was added in the extents code
path by commit 02d262dffcf4c.  The problem is that i_mutex will not
block DIO readers in dioread_nolock mode.  One of the problems with
not having done the code refactorization earlier was that a bug fixed
in one code path doesn't necessarily get fixed in another.

I'll add a comment to this effect in the commit description.

> > +	if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
> > +		credits = ext4_writepage_trans_blocks(inode);
> > +	else
> > +		credits = ext4_blocks_for_truncate(inode);
> > +	handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE,
> > +				    ext4_blocks_for_truncate(inode));
> 
> Hmm, shouldn't we be using 'credits' instead of
> ext4_blocks_for_truncate(inode) here ?

Yes, good catch!

Thanks,

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-03-27  2:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25  0:06 [PATCH 0/7] ext4 code simplification and clean ups Theodore Ts'o
2013-03-25  0:06 ` [PATCH 1/7] ext4: collapse handling of data=ordered and data=writeback codepaths Theodore Ts'o
2013-03-27 12:57   ` Lukáš Czerner
2013-03-25  0:06 ` [PATCH 2/7] ext4: fold ext4_generic_write_end() into ext4_write_end() Theodore Ts'o
2013-03-27 12:58   ` Lukáš Czerner
2013-03-27 15:35   ` Jan Kara
2013-03-25  0:06 ` [PATCH 3/7] ext4: fold ext4_alloc_blocks() in ext4_alloc_branch() Theodore Ts'o
2013-03-27 17:01   ` Jan Kara
2013-03-25  0:06 ` [PATCH 4/7] ext4: refactor punch hole code Theodore Ts'o
     [not found]   ` <alpine.LFD.2.00.1303261334060.2455@(none)>
2013-03-27  2:38     ` Theodore Ts'o [this message]
2013-03-27 10:49       ` Lukáš Czerner
2013-03-25  0:06 ` [PATCH 5/7] ext4: refactor truncate code Theodore Ts'o
     [not found]   ` <alpine.LFD.2.00.1303271128480.2455@(none)>
2013-03-27 12:36     ` Theodore Ts'o
2013-03-27 13:31       ` Lukáš Czerner
2013-03-25  0:06 ` [PATCH 6/7] ext4: add mutex_is_locked() assertion to ext4_truncate() Theodore Ts'o
2013-03-26  9:31   ` Lukáš Czerner
2013-03-27  2:29     ` Theodore Ts'o
2013-03-25  0:06 ` [PATCH 7/7] ext4: add might_sleep() annotations Theodore Ts'o
2013-03-26  9:48   ` Lukáš Czerner
2013-03-26  9:49     ` Lukáš Czerner

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=20130327023816.GC2697@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.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 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).