From patchwork Thu Feb 28 18:26:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 224125 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7F6AE2C02C2 for ; Fri, 1 Mar 2013 05:11:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759988Ab3B1SLu (ORCPT ); Thu, 28 Feb 2013 13:11:50 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:53394 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754276Ab3B1SLt (ORCPT ); Thu, 28 Feb 2013 13:11:49 -0500 Received: by mail-pb0-f42.google.com with SMTP id xb4so1221794pbc.29 for ; Thu, 28 Feb 2013 10:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=DkOnU4R8etWyBH/M+ihSsfd94td7r8aRIoW5hXZeg94=; b=vdjfttDI9Ks5Lt7MVc0gUXmeapHus9/oHlHq7i4JnVk0vPtmKZ2x0MlOB0IJ0z8Vcd 2/8s5R/K2dq0dQMGMhvcaP5saSfCJewIi8BH55tcDPPSVH3hMD/Qr/7M9DM9quKagyii AfmVVknawDqjFwB8CRp1FJJNlSHZr/HRNAuTTHSWvDZ4vBGK+JxVz5/47MEupu+9e34B UYjSDs8fquIJHjy71FtPr77GgrJf9y3/oVhPtT2SUxyiEs+Jr+yiXG2lWm4OyikayoJB qJ352rDYMVqwVuQU402bT8ZSKHqlf559v8lS3yqKq5eAqEGYL/PI4eaDw2bnSWqWvAWT dP2Q== X-Received: by 10.66.182.134 with SMTP id ee6mr14736608pac.117.1362075109170; Thu, 28 Feb 2013 10:11:49 -0800 (PST) Received: from lz-desktop.taobao.ali.com ([182.92.247.2]) by mx.google.com with ESMTPS id jp9sm9100343pbb.7.2013.02.28.10.11.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 Feb 2013 10:11:48 -0800 (PST) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Dmitry Monakhov , "Theodore Ts'o" Subject: [PATCH 1/6] ext4: invalidate exntent-status-tree during extent_migration Date: Fri, 1 Mar 2013 02:26:39 +0800 Message-Id: <1362076004-10087-2-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <1362076004-10087-1-git-send-email-wenqing.lz@taobao.com> References: <1362076004-10087-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Dmitry Monakhov mext_replace_branches() will change inode's extents layout so we have to drop corresponding cache. TESTCASE: 301'th xfstest was not yet accepted to official xfstest's branch and can be found here: https://github.com/dmonakhov/xfstests/commit/7b7efeee30a41109201e2040034e71db9b66ddc0 Signed-off-by: Dmitry Monakhov Reviewed-by: Jan Kara Reviewed-by: Zheng Liu Cc: "Theodore Ts'o" --- fs/ext4/move_extent.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index d78c33e..c1f15b2 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -666,6 +666,14 @@ mext_replace_branches(handle_t *handle, struct inode *orig_inode, int replaced_count = 0; int dext_alen; + *err = ext4_es_remove_extent(orig_inode, from, count); + if (*err) + goto out; + + *err = ext4_es_remove_extent(donor_inode, from, count); + if (*err) + goto out; + /* Get the original extent for the block "orig_off" */ *err = get_ext_path(orig_inode, orig_off, &orig_path); if (*err)