From patchwork Fri Aug 2 09:49:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 264270 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 270902C007E for ; Fri, 2 Aug 2013 19:51:35 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758564Ab3HBJve (ORCPT ); Fri, 2 Aug 2013 05:51:34 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:55994 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758374Ab3HBJvd (ORCPT ); Fri, 2 Aug 2013 05:51:33 -0400 Received: by mail-pb0-f43.google.com with SMTP id md4so501694pbc.2 for ; Fri, 02 Aug 2013 02:51:33 -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=ixY3smO1pvGE1m4NJgIB0vAiFBjIeTVdXdbWwKALRRc=; b=ric2O3ZJh1tDIQU9mQlry0Ijjdii4FfMPZqeihevMvXIme+Q3T0sFyHY7YfsewIGv9 isXCW+s3//RuNaQ2B+O9omYBnE3uz9sdt3kotB2HTVbvqGM9mmtu5lsUlvQjd9Y6jmEt yiulwCUuE5HPj6TOCU9QM+tYne3l2lVamXyQyIkHy4XfQLfkkmtDy1QZs1wsYw5s7bDG ytlFF/BKY9g3XxkkacUaEmlLT7bfs7hQ8mrtJ06BixFZ7flzc/MY+eMFnzXB0LECuguD Ac2QBq/nwmK3N43w7pMuKny2A7IQmtq/m6/srA+7tVXZggTJ0cg2o9Wa+1jcwksR3TcQ rxvA== X-Received: by 10.66.216.197 with SMTP id os5mr9551165pac.73.1375437093262; Fri, 02 Aug 2013 02:51:33 -0700 (PDT) Received: from lz-devel.taobao.ali.com ([182.92.247.2]) by mx.google.com with ESMTPSA id il4sm5912193pbb.36.2013.08.02.02.51.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 02 Aug 2013 02:51:32 -0700 (PDT) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Theodore Ts'o , Zheng Liu Subject: [PATCH v1 19/22] e2fsck: check inline_data in pass3 Date: Fri, 2 Aug 2013 17:49:46 +0800 Message-Id: <1375436989-18948-20-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.9.7 In-Reply-To: <1375436989-18948-1-git-send-email-wenqing.lz@taobao.com> References: <1375436989-18948-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 In e2fsck_expand_directory() we don't handle a dir with inline data because when this function is called the directory inode shouldn't contains inline data. Signed-off-by: Theodore Ts'o Signed-off-by: Zheng Liu --- e2fsck/pass3.c | 12 ++++++++++++ e2fsck/rehash.c | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index a379e9b..5052345 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -787,6 +787,18 @@ errcode_t e2fsck_expand_directory(e2fsck_t ctx, ext2_ino_t dir, es.ctx = ctx; es.dir = dir; + /* + * 'lost+found' dir shouldn't contains inline data. So we + * need to clear this flag. + */ + if (ext2fs_inode_has_inline_data(fs, dir)) { + retval = ext2fs_read_inode(fs, dir, &inode); + if (retval) + return retval; + inode.i_flags &= ~EXT4_INLINE_DATA_FL; + e2fsck_write_inode(ctx, dir, &inode, "clear inline_data flag"); + } + retval = ext2fs_block_iterate3(fs, dir, BLOCK_FLAG_APPEND, 0, expand_dir_proc, &es); diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index 5592e3f..82aeddd 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -937,7 +937,8 @@ void e2fsck_rehash_directories(e2fsck_t ctx) #if 0 fix_problem(ctx, PR_3A_OPTIMIZE_DIR, &pctx); #endif - pctx.errcode = e2fsck_rehash_dir(ctx, ino); + if (!ext2fs_inode_has_inline_data(ctx->fs, ino)) + pctx.errcode = e2fsck_rehash_dir(ctx, ino); if (pctx.errcode) { end_problem_latch(ctx, PR_LATCH_OPTIMIZE_DIR); fix_problem(ctx, PR_3A_OPTIMIZE_DIR_ERR, &pctx);