Bug 465984 - resize2fs doesn't recognize bogus argument, ending in infinite loop
resize2fs doesn't recognize bogus argument, ending in infinite loop
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-07 11:52 EDT by Petr Muller
Modified: 2016-09-19 22:04 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-05 23:07:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Muller 2008-10-07 11:52:58 EDT
Description of problem:
I have a file containing ext2 filesystem (created just by mke2fs -F file).
When I've accidentally gave resize2f an bogus size argument, the command went on crazy loop instead of some graceful 'learn to type, user' refusal.

# resize2fs /tmp/tmp.lntZtMFvz8/fake-disk bogus 2> log
Resizing the filesystem on /tmp/tmp.lntZtMFvz8/fake-disk to 0 (1k) blocks.
...waiting for 10 seconds... ok, thats enough
^C
[root@dhcp-lab-123 smoke-test]# cat log | wc -l
627587
[root@dhcp-lab-123 smoke-test]# head log
resize2fs 1.41.0 (10-Jul-2008)
Illegal block number passed to ext2fs_test_block_bitmap #1 for block bitmap for /tmp/tmp.lntZtMFvz8/fake-disk
...the same message repeated zillion times...

Version-Release number of selected component (if applicable):
resize2fs 1.41.0 (10-Jul-2008)
[root@dhcp-lab-123 smoke-test]# rpm -q e2fsprogs
e2fsprogs-1.41.0-2.fc9.x86_64

How reproducible:
always for me

Steps to Reproduce:
1. dd if=/dev/zero of=gggg bs=1024k count=42
2. mke2fs -F gggg
3. resize2fs  gggg bogus 

Actual results:
loop 

Expected results:
graceful end and some user insult

Additional info:
I've tried that on RHEL5.2 e2fsprogs. resize2fs handles this case gracefully there:
# resize2fs /tmp/disk rd
resize2fs 1.39 (29-May-2006)
resize2fs: bad filesystem size - rd
Comment 1 Eric Sandeen 2008-10-07 11:58:55 EDT
Thanks, I'll look into this (and think of some suitable insult ....)
Comment 2 Eric Sandeen 2008-10-10 18:42:30 EDT
I've sent a patch upstream for this.

http://marc.info/?l=linux-ext4&m=122367830026005&w=2

(_("Invalid new size: %s\n"), new_size_str)

is the only insult I came up with :)
Comment 4 Fedora Update System 2008-10-13 17:06:16 EDT
e2fsprogs-1.41.3-2.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/e2fsprogs-1.41.3-2.fc9
Comment 5 Fedora Update System 2008-10-15 22:12:13 EDT
e2fsprogs-1.41.3-2.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update e2fsprogs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-8884
Comment 6 Fedora Update System 2008-11-05 23:07:01 EST
e2fsprogs-1.41.3-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.