From patchwork Fri Jan 11 17:52:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 211390 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 0A53C2C0334 for ; Sat, 12 Jan 2013 04:52:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754869Ab3AKRw4 (ORCPT ); Fri, 11 Jan 2013 12:52:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46168 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754776Ab3AKRwz (ORCPT ); Fri, 11 Jan 2013 12:52:55 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0BHqtHj028192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Jan 2013 12:52:55 -0500 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0BHqriv021376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jan 2013 12:52:54 -0500 Message-ID: <50F05175.8060502@redhat.com> Date: Fri, 11 Jan 2013 11:52:53 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: ext4 development CC: Carlos Maiolino Subject: [PATCH] resize2fs: add debug switch to use old online interface X-Enigmail-Version: 1.4.6 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The old online resize ioctl interfaces are still present in the kernel; add a debug switch to resize2fs to be able to test them. Signed-off-by: Eric Sandeen --- -- 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/resize/online.c b/resize/online.c index d3d3546..9b38ac8 100644 --- a/resize/online.c +++ b/resize/online.c @@ -22,7 +22,7 @@ extern char *program_name; #define MAX_32_NUM ((((unsigned long long) 1) << 32) - 1) errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, - blk64_t *new_size, int flags EXT2FS_ATTR((unused))) + blk64_t *new_size, int flags) { #ifdef __linux__ struct ext2_new_group_input input; @@ -94,9 +94,11 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, exit(1); } - if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { + if (flags & RESIZE_DEBUG_OLD || + ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { /* - * If kernel does not support EXT4_IOC_RESIZE_FS, use the + * If kernel does not support EXT4_IOC_RESIZE_FS, or -d 16 + * is specified on the resize2fs command line, use the * old online resize. Note that the old approach does not * handle >32 bit file systems * @@ -109,7 +111,9 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, * in the kernel sources. This is probably a kernel * bug, but work around it here. */ - if ((errno != ENOTTY) && (errno != EINVAL)) { + if (flags & RESIZE_DEBUG_OLD) { + printf("Old resize interface requested.\n"); + } else if ((errno != ENOTTY) && (errno != EINVAL)) { if (errno == EPERM) com_err(program_name, 0, _("Permission denied to resize filesystem")); diff --git a/resize/resize2fs.8.in b/resize/resize2fs.8.in index 9ff6e0a..766c4d8 100644 --- a/resize/resize2fs.8.in +++ b/resize/resize2fs.8.in @@ -99,6 +99,8 @@ from the following list: 4 \-\ Debug inode relocations .br 8 \-\ Debug moving the inode table +.br + 16 \-\ Debug old online resize interface .TP .B \-f Forces resize2fs to proceed with the filesystem resize operation, overriding diff --git a/resize/resize2fs.h b/resize/resize2fs.h index 2184759..58fc04d 100644 --- a/resize/resize2fs.h +++ b/resize/resize2fs.h @@ -76,6 +76,8 @@ typedef struct ext2_sim_progress *ext2_sim_progmeter; #define RESIZE_DEBUG_BMOVE 0x0002 #define RESIZE_DEBUG_INODEMAP 0x0004 #define RESIZE_DEBUG_ITABLEMOVE 0x0008 +/* old online resize interface */ +#define RESIZE_DEBUG_OLD 0x0010 #define RESIZE_PERCENT_COMPLETE 0x0100 #define RESIZE_VERBOSE 0x0200