Bug 170143 - rm command hangs when removing a symlink on ext2 loop filesystem
rm command hangs when removing a symlink on ext2 loop filesystem
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Staubach
Brian Brock
:
: 180028 (view as bug list)
Depends On:
Blocks: 181409
  Show dependency treegraph
 
Reported: 2005-10-07 14:17 EDT by rich turner
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2006-0575
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-10 17:24:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Reproducible testcase (413 bytes, text/plain)
2006-02-13 17:22 EST, Peter Staubach
no flags Details
Proposed patch (725 bytes, patch)
2006-02-13 17:40 EST, Peter Staubach
no flags Details | Diff

  None (edit)
Description rich turner 2005-10-07 14:17:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7 SUSE/1.0.7-0.1

Description of problem:
when i try to remove a symbollic link from an ext2 loop filesystem the system hangs. this does not happen if i use ext3

Version-Release number of selected component (if applicable):
e2fsprogs-1.35-11.6.EL4 kernel-2.6.9-5.EL

How reproducible:
Always

Steps to Reproduce:
1. losetup /dev/loop0
2. dd if=/dev/zero of=/tmp/tmploopfs
3. mkfs.ext2 -F -N 3401 -m 0 /tmp/tmploopfs
4. mount -t ext2 -o loop,sync /tmp/tmploopfs /mnt
5. cp -Rpd /tmp/testfile /mnt
6. ln -sf /mnt/testfile /mnt/testlink
7. rm /mnt/testlink
  

Actual Results:  the rm command just hangs

Expected Results:  /mnt/testlink should have been removed and i should be at a command prompt

Additional info:

if i use mkfs.ext3 instead of mkfs.ext2 it performs as expected
Comment 1 rich turner 2005-10-07 14:19:56 EDT
step #2 should read:
dd if=/dev/zero of=/tmp/tmploopfs bs=1k count=32768
Comment 2 Thomas Woerner 2005-11-10 09:41:57 EST
This seems not to be a userland e2fsprogs problem. Assigning to kernel.
Comment 3 Peter Staubach 2006-02-13 17:22:02 EST
Created attachment 124582 [details]
Reproducible testcase
Comment 4 Peter Staubach 2006-02-13 17:22:58 EST
I attached a testcase which was constructed out of the directions above.
Comment 5 Peter Staubach 2006-02-13 17:27:14 EST
The problem seems to be that ext2_xattr_delete_inode() calls
lock_buffer(bh) and then, because the file system was mounted
with the "sync" option, calls sync_dirty_buffer(bh).  The
routine, sync_dirty_buffer, immediately calls lock_buffer(bh),
again.

This is a deadlock.  The solution is to call unlock_dirty_buffer(bh)
before invoking sync_dirty_buffer(bh) so that the buffer head is
unlocked.

I alao rearranged and updated some debugging code to match the
change in locking.
Comment 6 Peter Staubach 2006-02-13 17:40:11 EST
Created attachment 124585 [details]
Proposed patch
Comment 7 Peter Staubach 2006-02-14 09:11:58 EST
*** Bug 180028 has been marked as a duplicate of this bug. ***
Comment 12 Red Hat Bugzilla 2006-08-10 17:24:15 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0575.html

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