ChangeLog, main.c, resize2fs.c, resize2fs.h:
  Change the progress function to return an errcode_t; this allows the
  progress function to return a error indicating a user-requested
  cancel.

diff --git a/resize/ChangeLog b/resize/ChangeLog
index a4eabff..a9b9803 100644
--- a/resize/ChangeLog
+++ b/resize/ChangeLog
@@ -1,3 +1,9 @@
+Tue Feb 24 15:22:52 1998  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+	* Change the progress function to return an errcode_t; this allows
+		the progress function to return a error indicating a
+		user-requested cancel.
+
 1998-02-20  Theodore Y. Ts'o  <tytso@edt.mit.edu>
 
 	* main.c (check_mount, main): Resize2fs now checks the size of the
diff --git a/resize/main.c b/resize/main.c
index 7e25a8a..b251886 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -28,8 +28,8 @@
 	exit (1);
 }
 
-static void resize_progress_func(ext2_resize_t rfs, int pass,
-				 unsigned long cur, unsigned long max)
+static errcode_t resize_progress_func(ext2_resize_t rfs, int pass,
+				      unsigned long cur, unsigned long max)
 {
 	ext2_sim_progmeter progress;
 	const char	*label;
@@ -37,7 +37,7 @@
 
 	progress = (ext2_sim_progmeter) rfs->prog_data;
 	if (max == 0)
-		return;
+		return 0;
 	if (cur == 0) {
 		if (progress)
 			ext2fs_progress_close(progress);
@@ -77,6 +77,7 @@
 		progress = 0;
 		rfs->prog_data = 0;
 	}
+	return 0;
 }
 
 static void check_mount(char *device_name)
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 30b6c8d..993f534 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -63,7 +63,7 @@
  * This is the top-level routine which does the dirty deed....
  */
 errcode_t resize_fs(ext2_filsys fs, blk_t new_size, int flags,
-		    void (*progress)(ext2_resize_t rfs, int pass,
+		    errcode_t (*progress)(ext2_resize_t rfs, int pass,
 				     unsigned long cur,
 				     unsigned long max))
 {
@@ -327,9 +327,12 @@
 
 	adj = rfs->old_fs->group_desc_count;
 	max_group = fs->group_desc_count - adj;
-	if (rfs->progress)
-		rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
-			      0, max_group);
+	if (rfs->progress) {
+		retval = rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
+				       0, max_group);
+		if (retval)
+			goto errout;
+	}
 	for (i = rfs->old_fs->group_desc_count;
 	     i < fs->group_desc_count; i++) {
 		memset(&fs->group_desc[i], 0,
@@ -375,10 +378,12 @@
 		if (retval) goto errout;
 
 		io_channel_flush(fs->io);
-		if (rfs->progress)
-			rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
-				      i - adj + 1, max_group);
-		
+		if (rfs->progress) {
+			retval = rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
+					       i - adj + 1, max_group);
+			if (retval)
+				goto errout;
+		}
 		group_block += fs->super->s_blocks_per_group;
 	}
 	io_channel_flush(fs->io);
@@ -779,9 +784,12 @@
 	retval =  ext2fs_iterate_extent(rfs->bmap, 0, 0, 0);
 	if (retval) goto errout;
 
-	if (rfs->progress)
-		(rfs->progress)(rfs, E2_RSZ_BLOCK_RELOC_PASS, 0, to_move);
-
+	if (rfs->progress) {
+		retval = (rfs->progress)(rfs, E2_RSZ_BLOCK_RELOC_PASS,
+					 0, to_move);
+		if (retval)
+			goto errout;
+	}
 	while (1) {
 		retval = ext2fs_iterate_extent(rfs->bmap, &old_blk, &new_blk, &size);
 		if (retval) goto errout;
@@ -808,8 +816,11 @@
 			moved += c;
 			if (rfs->progress) {
 				io_channel_flush(fs->io);
-				(rfs->progress)(rfs, E2_RSZ_BLOCK_RELOC_PASS, 
+				retval = (rfs->progress)(rfs,
+						E2_RSZ_BLOCK_RELOC_PASS,
 						moved, to_move);
+				if (retval)
+					goto errout;
 			}
 		} while (size > 0);
 		io_channel_flush(fs->io);
@@ -880,6 +891,7 @@
 				   dgrp_t group, void * priv_data)
 {
 	ext2_resize_t rfs = (ext2_resize_t) priv_data;
+	errcode_t		retval;
 
 	/*
 	 * This check is to protect against old ext2 libraries.  It
@@ -890,8 +902,10 @@
 
 	if (rfs->progress) {
 		io_channel_flush(fs->io);
-		(rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
-				group+1, fs->group_desc_count);
+		retval = (rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
+					 group+1, fs->group_desc_count);
+		if (retval)
+			return retval;
 	}
 	
 	return 0;
@@ -925,10 +939,12 @@
 	start_to_move = (rfs->new_fs->group_desc_count *
 			 rfs->new_fs->super->s_inodes_per_group);
 	
-	if (rfs->progress)
-		(rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
-				0, rfs->old_fs->group_desc_count);
-	
+	if (rfs->progress) {
+		retval = (rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
+					 0, rfs->old_fs->group_desc_count);
+		if (retval)
+			goto errout;
+	}
 	ext2fs_set_inode_callback(scan, progress_callback, (void *) rfs);
 	pb.rfs = rfs;
 	pb.inode = &inode;
@@ -1027,6 +1043,7 @@
 
 struct istruct {
 	ext2_resize_t rfs;
+	errcode_t	err;
 	unsigned long	max;
 	int		num;
 };
@@ -1036,12 +1053,15 @@
 				   int	blocksize, char *buf, void *priv_data)
 {
 	struct istruct *is = (struct istruct *) priv_data;
-	ino_t	new_inode;
+	ino_t		new_inode;
 
 	if (is->rfs->progress && offset == 0) {
 		io_channel_flush(is->rfs->old_fs->io);
-		(is->rfs->progress)(is->rfs, E2_RSZ_INODE_REF_UPD_PASS,
-				++is->num, is->max);
+		is->err = (is->rfs->progress)(is->rfs,
+					      E2_RSZ_INODE_REF_UPD_PASS,
+					      ++is->num, is->max);
+		if (is->err)
+			return DIRENT_ABORT;
 	}
 
 	if (!dirent->inode)
@@ -1078,15 +1098,26 @@
 	is.num = 0;
 	is.max = ext2fs_dblist_count(rfs->old_fs->dblist);
 	is.rfs = rfs;
+	is.err = 0;
 
-	if (rfs->progress)
-		(rfs->progress)(rfs, E2_RSZ_INODE_REF_UPD_PASS,
-				0, is.max);
+	if (rfs->progress) {
+		retval = (rfs->progress)(rfs, E2_RSZ_INODE_REF_UPD_PASS,
+					 0, is.max);
+		if (retval)
+			goto errout;
+	}
 	
 	retval = ext2fs_dblist_dir_iterate(rfs->old_fs->dblist,
 					   DIRENT_FLAG_INCLUDE_EMPTY, 0,
 					   check_and_change_inodes, &is);
+	if (retval)
+		goto errout;
+	if (is.err) {
+		retval = is.err;
+		goto errout;
+	}
 
+errout:
 	ext2fs_free_extent_table(rfs->imap);
 	rfs->imap = 0;
 	return retval;
@@ -1145,8 +1176,12 @@
 	if (to_move == 0)
 		return 0;
 
-	if (rfs->progress)
-		rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS, 0, to_move);
+	if (rfs->progress) {
+		retval = rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,
+				       0, to_move);
+		if (retval)
+			goto errout;
+	}
 
 	rfs->old_fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
 
@@ -1209,8 +1244,10 @@
 		ext2fs_mark_super_dirty(rfs->old_fs);
 		if (rfs->progress) {
 			ext2fs_flush(rfs->old_fs);
-			rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,
-				      ++moved, to_move);
+			retval = rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,
+					       ++moved, to_move);
+			if (retval)
+				goto errout;
 		}
 	}
 	ext2fs_flush(fs);
diff --git a/resize/resize2fs.h b/resize/resize2fs.h
index 5d96353..cc89f4f 100644
--- a/resize/resize2fs.h
+++ b/resize/resize2fs.h
@@ -81,7 +81,7 @@
 	/*
 	 * For the progress meter
 	 */
-	void		(*progress)(ext2_resize_t rfs, int pass,
+	errcode_t	(*progress)(ext2_resize_t rfs, int pass,
 				    unsigned long cur,
 				    unsigned long max);
 	void		*prog_data;
@@ -99,8 +99,8 @@
 
 /* prototypes */
 extern errcode_t resize_fs(ext2_filsys fs, blk_t new_size, int flags,
-			   void	(*progress)(ext2_resize_t rfs, int pass,
-					    unsigned long cur,
+			   errcode_t	(*progress)(ext2_resize_t rfs,
+					    int pass, unsigned long cur,
 					    unsigned long max));
 
 /* extent.c */