Bug 170143 - rm command hangs when removing a symlink on ext2 loop filesystem
Summary: rm command hangs when removing a symlink on ext2 loop filesystem
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Peter Staubach
QA Contact: Brian Brock
URL:
Whiteboard:
: 180028 (view as bug list)
Depends On:
Blocks: 181409
TreeView+ depends on / blocked
 
Reported: 2005-10-07 18:17 UTC by rich turner
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHSA-2006-0575
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-10 21:24:14 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0575 0 normal SHIPPED_LIVE Important: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 4 2006-08-10 04:00:00 UTC

Description rich turner 2005-10-07 18:17:44 UTC
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 18:19:56 UTC
step #2 should read:
dd if=/dev/zero of=/tmp/tmploopfs bs=1k count=32768

Comment 2 Thomas Woerner 2005-11-10 14:41:57 UTC
This seems not to be a userland e2fsprogs problem. Assigning to kernel.

Comment 3 Peter Staubach 2006-02-13 22:22:02 UTC
Created attachment 124582 [details]
Reproducible testcase

Comment 4 Peter Staubach 2006-02-13 22:22:58 UTC
I attached a testcase which was constructed out of the directions above.

Comment 5 Peter Staubach 2006-02-13 22:27:14 UTC
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 22:40:11 UTC
Created attachment 124585 [details]
Proposed patch

Comment 7 Peter Staubach 2006-02-14 14:11:58 UTC
*** Bug 180028 has been marked as a duplicate of this bug. ***

Comment 12 Red Hat Bugzilla 2006-08-10 21:24:15 UTC
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.