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.
Created attachment 127304 [details] Patch to loop.c that seems to work properly with my GFS fix for 164499.
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
Eric, I just tested your patch to loop.c and verified it works properly with GFS and my fix for bz 164499.
patch sent to rhkernel-list
QE ack for 4.5. Patch has been confirmed in comment 6.
committed in stream U5 build 42.17. A test kernel with this patch is available from http://people.redhat.com/~jbaron/rhel4/
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.
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