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
step #2 should read: dd if=/dev/zero of=/tmp/tmploopfs bs=1k count=32768
This seems not to be a userland e2fsprogs problem. Assigning to kernel.
Created attachment 124582 [details] Reproducible testcase
I attached a testcase which was constructed out of the directions above.
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.
Created attachment 124585 [details] Proposed patch
*** Bug 180028 has been marked as a duplicate of this bug. ***
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