All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, wangxg.fnst@cn.fujitsu.com
Subject: Re: [PATCH] ext4: move_extent explicitly invalidate page buffers
Date: Thu, 23 Oct 2014 17:03:31 +0400	[thread overview]
Message-ID: <87a94n0wgs.fsf@openvz.org> (raw)
In-Reply-To: <1414064938-2496-1-git-send-email-dmonakhov@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]

Dmitry Monakhov <dmonakhov@openvz.org> writes:

> In hard core test-cases such as ext4/301, ext4/302 some bh may
> becomes dirty so try_to_release_page() will fail and result in
> false positive EBUSY failures. We can easily fix that by
> explicit ->invalidatepage() after we holds page which is locked
> and uptodate.
Sorry. This patch is not correct. Please ignore it.
>
> Tested-by: Xiaoguang Wang<wangxg.fnst@cn.fujitsu.com>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/ext4/move_extent.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index c2b2b02..76c45b6 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -348,8 +348,9 @@ again:
>  		     !try_to_release_page(pagep[0], 0)) ||
>  		    (page_has_private(pagep[1]) &&
>  		     !try_to_release_page(pagep[1], 0))) {
> -			*err = -EBUSY;
> -			goto drop_data_sem;
> +			/* One of buffers is busy, fall back data copy */
> +			ext4_double_up_write_data_sem(orig_inode, donor_inode);
> +			goto data_copy;
>  		}
>  		replaced_count = ext4_swap_extents(handle, orig_inode,
>  						   donor_inode, orig_blk_offset,
> @@ -360,12 +361,15 @@ again:
>  		goto unlock_pages;
>  	}
>  data_copy:
> -	*err = mext_page_mkuptodate(pagep[0], from, from + replaced_size);
> +	/* In order to drop all buffers we have to make page fully uptodate */
> +	*err = mext_page_mkuptodate(pagep[0], 0, PAGE_CACHE_SIZE);
>  	if (*err)
>  		goto unlock_pages;
>  
>  	/* At this point all buffers in range are uptodate, old mapping layout
>  	 * is no longer required, try to drop it now. */
> +	do_invalidatepage(pagep[0], 0, PAGE_CACHE_SIZE);
> +	do_invalidatepage(pagep[1], 0, PAGE_CACHE_SIZE);
>  	if ((page_has_private(pagep[0]) && !try_to_release_page(pagep[0], 0)) ||
>  	    (page_has_private(pagep[1]) && !try_to_release_page(pagep[1], 0))) {
>  		*err = -EBUSY;
> -- 
> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2014-10-23 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 11:48 [PATCH] ext4: move_extent explicitly invalidate page buffers Dmitry Monakhov
2014-10-23 13:03 ` Dmitry Monakhov [this message]
2014-12-10  9:21   ` Xiaoguang Wang
2014-12-10 10:25     ` Dmitry Monakhov
2014-12-10 11:04       ` Xiaoguang Wang
2015-01-11  9:50       ` Xiaoguang Wang
2015-01-13 13:32         ` Dmitry Monakhov
2015-01-19  7:00           ` Xiaoguang Wang

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=87a94n0wgs.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /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.