Bug 465984 - resize2fs doesn't recognize bogus argument, ending in infinite loop
Summary: resize2fs doesn't recognize bogus argument, ending in infinite loop
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-07 15:52 UTC by Petr Muller
Modified: 2016-09-20 02:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-11-06 04:07:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Petr Muller 2008-10-07 15:52:58 UTC
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 15:58:55 UTC
Thanks, I'll look into this (and think of some suitable insult ....)

Comment 2 Eric Sandeen 2008-10-10 22:42:30 UTC
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 21:06:16 UTC
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-16 02:12:13 UTC
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-06 04:07:01 UTC
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.