From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Subject: [PATCH] resize2fs: add debug switch to use old online interface
Date: Fri, 11 Jan 2013 11:52:53 -0600 [thread overview]
Message-ID: <50F05175.8060502@redhat.com> (raw)
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 <sandeen@redhat.com>
---
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
next reply other threads:[~2013-01-11 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 17:52 Eric Sandeen [this message]
2013-01-12 0:30 ` [PATCH] resize2fs: add debug switch to use old online interface Theodore Ts'o
2013-01-12 0:33 ` Eric Sandeen
2013-01-12 23:04 ` Theodore Ts'o
2013-01-14 12:10 ` Carlos Maiolino
2013-01-14 12:50 ` Theodore Ts'o
2013-01-14 13:09 ` Carlos Maiolino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F05175.8060502@redhat.com \
--to=sandeen@redhat.com \
--cc=cmaiolino@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.