From patchwork Mon Apr 16 11:39:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 152801 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 8807BB6FAA for ; Mon, 16 Apr 2012 21:34:26 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753284Ab2DPLeZ (ORCPT ); Mon, 16 Apr 2012 07:34:25 -0400 Received: from mail-pz0-f52.google.com ([209.85.210.52]:62902 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030Ab2DPLeY (ORCPT ); Mon, 16 Apr 2012 07:34:24 -0400 Received: by mail-pz0-f52.google.com with SMTP id e40so6801134dak.11 for ; Mon, 16 Apr 2012 04:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=CNjvVSu1OAuXGVNkQpGRfNdN9AG494ZsHbu/XIQ6XQo=; b=h9uHHR0NxUiyiHxahsp0dGLY42gWJFxo4r9FhlenilxfIxyj/u1Jr3edDRtsr85c2Z QpB1AHyh4NOGQ1QNSGx8e5g7rLKWcxDA9VF2yfxnwlXg5ek28lXbw5pHlr+vGiKjkrHG M7PLy2PKpYm1toRNJ3gNxGCcs1L7Ghdz2vFI0LNDwnsqKJDUVGsI3R4zpcdZU7kvU2zl UR6nJI6BMzUXvnu0t0MQKcl8o6fd1xCLu0Evt/T1i+AmrvB/DIZ15qP2ijVYJF/1bEoP OzCCKk+mgOO27QYaVGLIPEDw4OPBhXWk0BKRCIvf55GScFOzwrW0YXnjo/inqCEzNQem Ogxg== Received: by 10.68.224.195 with SMTP id re3mr27197190pbc.90.1334576064406; Mon, 16 Apr 2012 04:34:24 -0700 (PDT) Received: from localhost.localdomain ([182.92.247.2]) by mx.google.com with ESMTPS id l6sm17474160pbp.33.2012.04.16.04.34.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Apr 2012 04:34:23 -0700 (PDT) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Zheng Liu Subject: [PATCH 17/32] debugfs: make mkdir cmd support inline data Date: Mon, 16 Apr 2012 19:39:52 +0800 Message-Id: <1334576407-4007-18-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1334576407-4007-1-git-send-email-wenqing.lz@taobao.com> References: <1334576407-4007-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: Zheng Liu We need to reload inode in ext2fs_mkdir because inode with inline itself data is modified in ext2fs_link. Signed-off-by: Zheng Liu --- lib/ext2fs/mkdir.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c index b12bf2d..d9a8278 100644 --- a/lib/ext2fs/mkdir.c +++ b/lib/ext2fs/mkdir.c @@ -134,6 +134,10 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum, * Update parent inode's counts */ if (parent != ino) { + /* Reload parent inode */ + retval = ext2fs_read_inode(fs, parent, &parent_inode); + if (retval) + goto cleanup; parent_inode.i_links_count++; retval = ext2fs_write_inode(fs, parent, &parent_inode); if (retval)