From patchwork Fri Jun 10 06:02:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dilger X-Patchwork-Id: 99845 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 8729CB7001 for ; Fri, 10 Jun 2011 16:02:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804Ab1FJGCx (ORCPT ); Fri, 10 Jun 2011 02:02:53 -0400 Received: from idcmail-mo2no.shaw.ca ([64.59.134.9]:63875 "EHLO idcmail-mo2no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027Ab1FJGCw (ORCPT ); Fri, 10 Jun 2011 02:02:52 -0400 Received: from pd6ml1no-ssvc.prod.shaw.ca ([10.0.153.160]) by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 10 Jun 2011 00:02:52 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=sma64emKALigICJU+V2L7RL3kPAolu7RCFSKDgo279k= c=1 sm=1 a=kt6VLKxvHY4A:10 a=CYDyCxVgLFAA:10 a=BLceEmwcHowA:10 a=c23vf5CSMVc0QQz9B4a6RA==:17 a=ySfo2T4IAAAA:8 a=H1zTb_5fRCFjdsbWDDgA:9 a=i_E5QpYH4Kzknn7Me0YA:7 a=axWQYnUQhmgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO sookie.dilger.int) ([68.147.195.121]) by pd6ml1no-dmz.prod.shaw.ca with ESMTP; 10 Jun 2011 00:02:51 -0600 From: Andreas Dilger To: tytso@mit.edu, linux-ext4@vger.kernel.org Cc: Andreas Dilger Subject: [PATCH] debugfs: fix icheck finding blocks used for xattrs Date: Fri, 10 Jun 2011 00:02:50 -0600 Message-Id: <1307685770-6099-1-git-send-email-adilger@whamcloud.com> X-Mailer: git-send-email 1.7.3.4 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This was an "uninitialized variable" warning, but it turns out to be a real bug. Without this change, it is not possible to use "icheck" to find blocks that are used for the i_file_acl (xattr) block. Signed-off-by: Andreas Dilger --- debugfs/icheck.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debugfs/icheck.c b/debugfs/icheck.c index 643bc5b..729ac93 100644 --- a/debugfs/icheck.c +++ b/debugfs/icheck.c @@ -106,13 +106,15 @@ void do_icheck(int argc, char **argv) } while (ino) { + blk64_t blk; + if (!inode.i_links_count) goto next; bw.inode = ino; - if (ext2fs_file_acl_block(&inode)) { - blk64_t blk; + blk = ext2fs_file_acl_block(&inode); + if (blk) { icheck_proc(current_fs, &blk, 0, 0, 0, &bw); if (bw.blocks_left == 0)