Bug 187930 - loop.c: integrate upstream changes
loop.c: integrate upstream changes
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eric Sandeen
Brian Brock
Depends On:
Blocks: 164499 176344
  Show dependency treegraph
Reported: 2006-04-04 13:22 EDT by Robert Peterson
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-0304
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-07 21:06:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to loop.c that seems to work properly with my GFS fix for 164499. (13.75 KB, text/plain)
2006-04-04 13:22 EDT, Robert Peterson
no flags Details
minimal upstream loop.c patch (8.41 KB, patch)
2006-09-15 10:30 EDT, Eric Sandeen
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0304 normal SHIPPED_LIVE Updated kernel packages available for Red Hat Enterprise Linux 4 Update 5 2007-04-28 14:58:50 EDT

  None (edit)
Description Robert Peterson 2006-04-04 13:22:51 EDT
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:

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 13:22:51 EDT
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 10:30:21 EDT
Created attachment 136362 [details]
minimal upstream loop.c patch

Bob, is this more targeted backport sufficient?

Backport of
Comment 6 Robert Peterson 2006-09-19 14:41:45 EDT

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 14:50:26 EDT
patch sent to rhkernel-list
Comment 8 Jay Turner 2006-10-03 09:21:18 EDT
QE ack for 4.5.  Patch has been confirmed in comment 6.
Comment 9 Jason Baron 2006-10-10 11:22:38 EDT
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 Product and Program Management 2006-10-10 15:03:59 EDT
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
Comment 14 Red Hat Bugzilla 2007-05-07 21:06:06 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.


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