Bug 746284

Summary: resize2fs: on-line resize always fails when checking on-line resizing support
Product: [Fedora] Fedora Reporter: Lukáš Czerner <lczerner>
Component: e2fsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: esandeen, josef, kzak, oliver
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: e2fsprogs-1.42-0.5.WIP.1016.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-17 19:38:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
resize: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't exist none

Description Lukáš Czerner 2011-10-14 15:59:33 UTC
Description of problem:

Online resize on ext3/ext4 file systems always fails with the following error message:

 resize2fs: Inappropriate ioctl for device While checking for on-line resizing support


Version-Release number of selected component (if applicable):
resize2fs 1.42-WIP (9-Oct-2011)

How to reproduce:
Attempt to use on-line resize of ext3/ext4 file system.

  
Actual results:
fails

Expected results:
workt

Additional info:

The problem is in the new code added into e2fsptogs to support new on-line resize ioctl(), which should allow resizing >32 bit file systems. However such support does not exist in any released kenrel yet.

Even though the code tries to detect missing ioctl() and fallback to the old on-line resize, it fails to do so due to a bug:


 74 →       if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) {
 75 →       →       if (errno != EINVAL) {
 76 →       →       →       if (errno == EPERM)
 77 →       →       →       →       com_err(program_name, 0,
 78 →       →       →       →       _("Permission denied to resize filesystem"));
 79 →       →       →       else
 80 →       →       →       →       com_err(program_name, errno,
 81 →       →       →       →       _("While checking for on-line resizing "
 82 →       →       →       →         "support"));
 83 →       →       →       exit(1);
 84 →       →       }
 85 →       } else {                                                                                                                                                   
 86 →       →       close(fd);
 87 →       →       return 0;
 88 →       }

Comment 1 Lukáš Czerner 2011-10-14 16:01:36 UTC
Created attachment 528236 [details]
resize: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't exist

Patch posted upstream, waiting for review and merge.

Comment 2 Eric Sandeen 2011-10-17 19:38:26 UTC
Fixed upstream and in rawhide now.  Thanks Lukáš!

-Eric