From patchwork Sun Apr 7 18:42:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 234516 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 0BA442C00A5 for ; Mon, 8 Apr 2013 04:42:27 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934268Ab3DGSmZ (ORCPT ); Sun, 7 Apr 2013 14:42:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55715 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934266Ab3DGSmZ (ORCPT ); Sun, 7 Apr 2013 14:42:25 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r37IgKir009944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 7 Apr 2013 14:42:20 -0400 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r37IgIIb027088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 7 Apr 2013 14:42:19 -0400 Message-ID: <5161BE0A.5070003@redhat.com> Date: Sun, 07 Apr 2013 13:42:18 -0500 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: ext4 development CC: David Shaw , Harald Reindl Subject: [PATCH] e2fsprogs: allow 0-length xattr values in e2fsck X-Enigmail-Version: 1.5.1 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org e2fsck thinks that this: # touch mnt/testfile1 # setfattr -n "user.test" mnt/testfile1 results in a filesystem with corruption: Pass 1: Checking inodes, blocks, and sizes Extended attribute in inode 12 has a value size (0) which is invalid Clear? yes but as far as I can tell, there is absolutely nothing wrong with a 0-length value on an extended attribute. Just remove the check. Reported-by: David Shaw Reported-by: Harald Reindl Addresses-Red-Hat-Bugzilla: #557959 Signed-off-by: Eric Sandeen --- Strange that this has been in e2fsck since 2005; apologies to David in particular for not addressing the bug he filed much sooner, I had assumed that this was some strange corruption, not a simple logic error / change. -- 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 diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index a20b57b..94df36d 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -307,7 +307,7 @@ static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx) remain -= EXT2_EXT_ATTR_SIZE(entry->e_name_len); /* check value size */ - if (entry->e_value_size == 0 || entry->e_value_size > remain) { + if (entry->e_value_size > remain) { pctx->num = entry->e_value_size; problem = PR_1_ATTR_VALUE_SIZE; goto fix;