linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] e2fsprogs: add 64bit-online-resize support
@ 2011-08-30  8:13 Yongqiang Yang
  2011-09-14 15:56 ` Ted Ts'o
  0 siblings, 1 reply; 4+ messages in thread
From: Yongqiang Yang @ 2011-08-30  8:13 UTC (permalink / raw)
  To: tytso; +Cc: adilger, linux-ext4, Yongqiang Yang

This patch adds 64bit-resize support to e2fsprogs.
---
 v1->v2:
   remove useless warning message.
 lib/ext2fs/ext2_fs.h |    1 +
 resize/online.c      |   19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index 54cb3d4..4fec5db 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -327,6 +327,7 @@ struct ext4_new_group_input {
 #define EXT2_IOC_GROUP_EXTEND		_IOW('f', 7, unsigned long)
 #define EXT2_IOC_GROUP_ADD		_IOW('f', 8,struct ext2_new_group_input)
 #define EXT4_IOC_GROUP_ADD		_IOW('f', 8,struct ext4_new_group_input)
+#define EXT4_IOC_RESIZE_FS		_IOW('f', 16, __u64)
 
 /*
  * Structure of an inode on the disk
diff --git a/resize/online.c b/resize/online.c
index 1d8d4ec..1b3589b 100644
--- a/resize/online.c
+++ b/resize/online.c
@@ -51,7 +51,7 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt,
 				  fs->super->s_first_data_block,
 				  EXT2_BLOCKS_PER_GROUP(fs->super)),
 		EXT2_DESC_PER_BLOCK(fs->super));
-	printf("old desc_blocks = %lu, new_desc_blocks = %lu\n",
+	printf("old_desc_blocks = %lu, new_desc_blocks = %lu\n",
 	       fs->desc_blocks, new_desc_blocks);
 	if (!(fs->super->s_feature_compat &
 	      EXT2_FEATURE_COMPAT_RESIZE_INODE) &&
@@ -69,6 +69,23 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt,
 	}
 
 	size=ext2fs_blocks_count(sb);
+
+	if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) {
+		if (errno != ENOTTY) {
+			if (errno == EPERM)
+				com_err(program_name, 0,
+				_("Permission denied to resize filesystem"));
+			else
+				com_err(program_name, errno,
+				_("While checking for on-line resizing "
+				  "support"));
+			exit(1);
+		}
+	} else {
+		close(fd);
+		return 0;
+	}
+
 	if (ioctl(fd, EXT2_IOC_GROUP_EXTEND, &size)) {
 		if (errno == EPERM)
 			com_err(program_name, 0,
-- 
1.7.5.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] e2fsprogs: add 64bit-online-resize support
  2011-08-30  8:13 [PATCH v2] e2fsprogs: add 64bit-online-resize support Yongqiang Yang
@ 2011-09-14 15:56 ` Ted Ts'o
  2011-09-15 14:36   ` Amir Goldstein
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Ts'o @ 2011-09-14 15:56 UTC (permalink / raw)
  To: Yongqiang Yang; +Cc: adilger, linux-ext4

On Tue, Aug 30, 2011 at 04:13:23PM +0800, Yongqiang Yang wrote:
> This patch adds 64bit-resize support to e2fsprogs.

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] e2fsprogs: add 64bit-online-resize support
  2011-09-14 15:56 ` Ted Ts'o
@ 2011-09-15 14:36   ` Amir Goldstein
  2011-09-15 15:16     ` Ted Ts'o
  0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2011-09-15 14:36 UTC (permalink / raw)
  To: Ted Ts'o; +Cc: Yongqiang Yang, adilger, linux-ext4

On Wed, Sep 14, 2011 at 6:56 PM, Ted Ts'o <tytso@mit.edu> wrote:
> On Tue, Aug 30, 2011 at 04:13:23PM +0800, Yongqiang Yang wrote:
>> This patch adds 64bit-resize support to e2fsprogs.
>
> Thanks, applied.
>


Hi Ted,

Are you planning to pull the kernel 64bit-resize patches for 3.2 merge window?

Cheers,
Amir.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] e2fsprogs: add 64bit-online-resize support
  2011-09-15 14:36   ` Amir Goldstein
@ 2011-09-15 15:16     ` Ted Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Ted Ts'o @ 2011-09-15 15:16 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Yongqiang Yang, adilger, linux-ext4

On Thu, Sep 15, 2011 at 05:36:14PM +0300, Amir Goldstein wrote:
> 
> Are you planning to pull the kernel 64bit-resize patches for 3.2
> merge window?

It depends on how much time I have.  My main priority is to get
another snapshot release of e2fsprogs out.  I have some $WORK projects
I need to focus on as well, and I've also been assisting with the
kernel.org security penetration cleanup, so my time has been pretty
badly slammed as of late.

I included the the userspace support for the new resize ioctl since
it's pretty simple, and very unlikely to change.

					- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-15 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30  8:13 [PATCH v2] e2fsprogs: add 64bit-online-resize support Yongqiang Yang
2011-09-14 15:56 ` Ted Ts'o
2011-09-15 14:36   ` Amir Goldstein
2011-09-15 15:16     ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).