+ if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) {
+ /*
+ * If kernel does not support EXT4_IOC_RESIZE_FS, use the
+ * old online resize. Note that the old approach does not
+ * handle >32 bit file systems
+ */
+ 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 ((ext2fs_blocks_count(sb) > MAX_32_NUM) ||
+ (*new_size > MAX_32_NUM)) {
+ com_err(program_name, 0,
+ _("Kernel does not support resizing a file system "
+ "this large"));
+ exit(1);
+ }
+ size = ext2fs_blocks_count(sb);
+