Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 187930

Summary: loop.c: integrate upstream changes
Product: Red Hat Enterprise Linux 4 Reporter: Robert Peterson <rpeterso>
Component: kernelAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: aviro, dhowells, jbaron, sct
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0304 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-08 01:06:06 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:
Bug Depends On:    
Bug Blocks: 164499, 176344    
Attachments:
Description Flags
Patch to loop.c that seems to work properly with my GFS fix for 164499.
none
minimal upstream loop.c patch none

Description Robert Peterson 2006-04-04 17:22:51 UTC
Description of problem:
The RHEL4 version of drivers/block/loop.c does not currently support
the write vfs method, it only supports the aops prepare_write and
commit_write.  The upstream kernels and Fedora kernels support using
write when prepare_write/commit_write are not available.
This makes it pretty much impossible to support loopback operations
properly on an underlying filesystem that is clustered like GFS.
See bz #164499 for more information on how to recreate the problem.

Right now, loop.c only uses prepare_write/commit_write aops methods
to operate on a filesystem.  These operations circumvent proper
cluster locking in the case of GFS.  In order to fix GFS, I need
loop.c to support the write method as it currently does in FC4/FC5
and the upstream kernels.

How reproducible:
Always

Steps to Reproduce:
1. Create a file in a GFS filesystem:
   dd if=/dev/zero of=/mnt/gfs/ext2_over_gfs bz=100M count=1
2. Format a filesystem on top of the file:
   mkfs.ext2 /mnt/gfs/ext2_over_gfs
3. Loopback mount the file:
   mount -o loop -text3 /mnt/gfs/ext2_over_gfs /mnt/test
  
Actual results:
Filesystem does not mount properly, assertion errors in dmesg.

Expected results:
Filesystem should mount properly.

Additional info:
I'm not sure how far we want to go to integrate the loop.c module
from upstream and how much we just want to port to get it to work.
I just took a version from the FC4 kernel, ported it to RHEL4, made
changes necessary for it to compile, and it seemed to work properly.
See attachment.  This patch may have things we don't necessarily
want to port to RHEL4.

Comment 1 Robert Peterson 2006-04-04 17:22:51 UTC
Created attachment 127304 [details]
Patch to loop.c that seems to work properly with my GFS fix for 164499.

Comment 5 Eric Sandeen 2006-09-15 14:30:21 UTC
Created attachment 136362 [details]
minimal upstream loop.c patch

Bob, is this more targeted backport sufficient?

Backport of
http://linux.bkbits.net:8080/linux-2.6/cset@1.1994.11.124?nav=index.html|src/|src/drivers|src/drivers/block|related/drivers/block/loop.c

Comment 6 Robert Peterson 2006-09-19 18:41:45 UTC
Eric,

I just tested your patch to loop.c and verified it works properly with
GFS and my fix for bz 164499.


Comment 7 Eric Sandeen 2006-09-22 18:50:26 UTC
patch sent to rhkernel-list

Comment 8 Jay Turner 2006-10-03 13:21:18 UTC
QE ack for 4.5.  Patch has been confirmed in comment 6.

Comment 9 Jason Baron 2006-10-10 15:22:38 UTC
committed in stream U5 build 42.17. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/


Comment 11 RHEL Program Management 2006-10-10 19:03:59 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 14 Red Hat Bugzilla 2007-05-08 01:06:06 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-2007-0304.html