Re: resize online with ext3?
Jürgen E. Fischer <[email protected]>
| Newsgroups | gmane.linux.evms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Ted,
On Fri, Dec 29, 2006 at 21:00:39 -0500, Theodore Tso wrote:
> The real problem is that I don't think anyone is actively developing
> or maintaining the plugin. I tried to take it on and enhance a few
> years ago, but the EVMS developers and I had some disagreements about
> whether it is worthwhile to maintain backwards source and ABI
> compatibility between plugins and successive releases of EVMS, and I
> ultimately decided that I had better things to do than to work on the
> EVMS ext2/3 plugin.
>
> Changing the ext3 plugin it to simply always try to do the online
> resizing, and simply fail if it can't really shouldn't be all that
> difficult.
Right, AFAIKS none at all. The following patch does it.
Hmmm, I don't see problems with it, does anyone else?
Juergen
diff -urp orig/evms-2.5.5/plugins/ext2/fs_ext2.c evms-2.5.5/plugins/ext2/fs_ext2.c
--- orig/evms-2.5.5/plugins/ext2/fs_ext2.c 2005-06-16 18:53:47.000000000 +0200
+++ evms-2.5.5/plugins/ext2/fs_ext2.c 2006-12-30 21:25:39.836021249 +0100
@@ -275,35 +275,39 @@ static int fs_expand( logical_volume_t *
LOG_ENTRY();
- /* get and validate current ext2/3 superblock */
- sb = (struct ext2_super_block *) volume->private_data;
- rc = fsim_get_ext2_superblock( volume, sb );
- if (rc) {
- goto errout;
- }
-
- if ((sb->s_lastcheck < sb->s_mtime) ||
- (sb->s_state & EXT2_ERROR_FS) ||
- ((sb->s_state & EXT2_VALID_FS) == 0)) {
- MESSAGE(_("Running fsck before expanding volume."));
- rc = fsim_fsck(volume, NULL, &status );
+ if (!EVMS_IS_MOUNTED(volume)) {
+ /* get and validate current ext2/3 superblock */
+ sb = (struct ext2_super_block *) volume->private_data;
+ rc = fsim_get_ext2_superblock( volume, sb );
if (rc) {
- MESSAGE(_("Attempt to execute fsck failed (%d). "
- "Aborting volume expand,"), rc);
goto errout;
}
- if (status >= 4) {
- MESSAGE(_("Aborting volume expand"));
- rc = status;
- goto errout;
+
+ if ((sb->s_lastcheck < sb->s_mtime) ||
+ (sb->s_state & EXT2_ERROR_FS) ||
+ ((sb->s_state & EXT2_VALID_FS) == 0)) {
+ MESSAGE(_("Running fsck before expanding volume."));
+ rc = fsim_fsck(volume, NULL, &status );
+ if (rc) {
+ MESSAGE(_("Attempt to execute fsck failed (%d). "
+ "Aborting volume expand,"), rc);
+ goto errout;
+ }
+ if (status >= 4) {
+ MESSAGE(_("Aborting volume expand"));
+ rc = status;
+ goto errout;
+ }
}
}
+#if 0 // kernel 2.6 support online expand
/* don't expand if mounted */
if (EVMS_IS_MOUNTED(volume)) {
rc = EBUSY;
goto errout;
}
+#endif
if (pipe(fds1)) {
rc = errno;
@@ -1366,10 +1370,14 @@ static int fs_can_expand_by(logical_volu
int rc = 0;
LOG_ENTRY();
+
+#if 0 // kernel 2.6 support online expand
if (EVMS_IS_MOUNTED(volume)) {
rc = EBUSY; /* If mounted, can't expand */
goto errout;
}
+#endif
+
fs_get_fs_limits( volume, /* reset limits */
&volume->min_fs_size,
&volume->max_fs_size,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Evms-devel mailing list
[email protected]
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel