linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH 3/3] ext4: fix incorrect locking in move_extent_per_page
Date: Mon, 21 Jul 2014 21:51:02 +0200	[thread overview]
Message-ID: <20140721195102.GC19942@quack.suse.cz> (raw)
In-Reply-To: <1405955089-12777-3-git-send-email-dmonakhov@openvz.org>

On Mon 21-07-14 19:04:49, Dmitry Monakhov wrote:
> If we have to copy data we must drop i_data_sem because of
> get_blocks() will be called inside mext_page_mkuptodate(), but later we must
> reacquire it again because we are about to change extent's tree
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
  Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/move_extent.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index 2484c7e..671a74b 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -1013,10 +1013,11 @@ data_copy:
>  		*err = -EBUSY;
>  		goto unlock_pages;
>  	}
> -
> +	ext4_double_down_write_data_sem(orig_inode, donor_inode);
>  	replaced_count = mext_replace_branches(handle, orig_inode, donor_inode,
>  					       orig_blk_offset,
>  					       block_len_in_page, err);
> +	ext4_double_up_write_data_sem(orig_inode, donor_inode);
>  	if (*err) {
>  		if (replaced_count) {
>  			block_len_in_page = replaced_count;
> -- 
> 1.7.1
> 
> --
> 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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-07-21 19:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 15:04 [PATCH 1/3] ext4: add i_data_sem sanity check Dmitry Monakhov
2014-07-21 15:04 ` [PATCH 2/3] ext4: use correct depth value Dmitry Monakhov
2014-07-21 19:48   ` Jan Kara
2014-07-28  2:31     ` Theodore Ts'o
2014-07-21 15:04 ` [PATCH 3/3] ext4: fix incorrect locking in move_extent_per_page Dmitry Monakhov
2014-07-21 19:51   ` Jan Kara [this message]
2014-07-28  2:33     ` Theodore Ts'o
2014-07-21 19:35 ` [PATCH 1/3] ext4: add i_data_sem sanity check Jan Kara
2014-07-28  2:29   ` Theodore Ts'o

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=20140721195102.GC19942@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).