Bug 404711

Summary: GFS2: Recursive locking on rgrp in gfs2_rename causes kernel BUG
Product: Red Hat Enterprise Linux 5 Reporter: Abhijith Das <adas>
Component: kernelAssignee: Don Zickus <dzickus>
Status: CLOSED ERRATA QA Contact: GFS Bugs <gfs-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: bmarzins, diegows, kanderso, lwang, rpeterso, swhiteho
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0314 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 15:02:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
This git patch checks for recursion in rgrp glocks none

Description Abhijith Das 2007-11-29 17:09:10 UTC
Description of problem:
This problem was initially discovered in bug #220052 while trying to install
RHEL5 with gfs2 as the root filesystem. Some screenshots of the panic are in
that bug report.

The first lock is requested to unlink an already existing
inode (replacing a file) and the second lock is requested when the destination
directory needs to alloc some space. It is rare that these two events happen
during the same rename call, and even more rare that these two instances try to
lock the same rgrp. It is, however, possible.

Running these set of commands 2-3 times in a gfs2 filesystem will trigger this
panic.

mkdir first second;
for i in `seq 1 78`; do touch first/foo$i; done;
mv first/* second/;
cp a100MBfile first/foo1;
mv first/foo1 second/; /* This mv, unlinks file 'second/foo1' and also causes
directory 'second' to trigger an allocation request */
rm -Rf first second;

Here, 78 is my magic number for the number of foo* files that the destination
directory can hold. Adding any more information to the directory will trigger
an allocation request.

Version-Release number of selected component (if applicable):


How reproducible:
fairly easy.

Steps to Reproduce:
1. Run the above set of instructions on a gfs2 filesystem a few times.

Comment 1 RHEL Program Management 2007-11-29 17:14:25 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 2 Abhijith Das 2007-11-29 20:07:27 UTC
Created attachment 273241 [details]
This git patch checks for recursion in rgrp glocks

Comment 4 Steve Whitehouse 2007-12-04 20:56:52 UTC
*** Bug 410981 has been marked as a duplicate of this bug. ***

Comment 5 Diego Woitasen 2007-12-06 17:45:02 UTC
FYI

The patch works for me. I ran the test program in bug 410981 without problems.

Comment 6 Don Zickus 2007-12-17 19:37:49 UTC
in 2.6.18-61.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 9 errata-xmlrpc 2008-05-21 15:02:34 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/RHBA-2008-0314.html