From mboxrd@z Thu Jan 1 00:00:00 1970 From: rpeterso@sourceware.org Date: 2 Aug 2006 17:21:20 -0000 Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op ... Message-ID: <20060802172120.24384.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Changes by: rpeterso at sourceware.org 2006-08-02 17:21:20 Modified files: gfs-kernel/src/gfs: incore.h inode.c ops_address.c Log message: This is a fix for bugzilla bz 164499 (Unable to mount loopback images from mounted GFS partition). The previous fix had a problem where any writes to files in the file system would cause the problem to reappear. For more details see: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=164499 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/incore.h.diff?cvsroot=cluster&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_address.c.diff?cvsroot=cluster&r1=1.12&r2=1.13 --- cluster/gfs-kernel/src/gfs/incore.h 2006/07/10 23:22:34 1.25 +++ cluster/gfs-kernel/src/gfs/incore.h 2006/08/02 17:21:19 1.26 @@ -617,6 +617,7 @@ unsigned int i_greedy; /* The amount of time to be greedy */ unsigned long i_last_pfault; /* The time of the last page fault */ + struct address_space_operations gfs_file_aops; }; /* --- cluster/gfs-kernel/src/gfs/inode.c 2006/07/10 23:22:34 1.24 +++ cluster/gfs-kernel/src/gfs/inode.c 2006/08/02 17:21:19 1.25 @@ -191,7 +191,9 @@ if (ip->i_di.di_type == GFS_FILE_REG) { tmp->i_op = &gfs_file_iops; tmp->i_fop = &gfs_file_fops; - tmp->i_mapping->a_ops = &gfs_file_aops; + memcpy(&ip->gfs_file_aops, &gfs_file_aops, + sizeof(struct address_space_operations)); + tmp->i_mapping->a_ops = &ip->gfs_file_aops; } else if (ip->i_di.di_type == GFS_FILE_DIR) { tmp->i_op = &gfs_dir_iops; tmp->i_fop = &gfs_dir_fops; --- cluster/gfs-kernel/src/gfs/ops_address.c 2006/07/14 18:44:42 1.12 +++ cluster/gfs-kernel/src/gfs/ops_address.c 2006/08/02 17:21:19 1.13 @@ -327,7 +327,7 @@ /* it's okay to do buffered writes without locking through sendfile. */ /* This is a kludge to get around the problem with loop.c because */ /* the upstream community rejected my changes to loop.c. */ - gfs_file_aops.commit_write = gfs_commit_write; + ip->gfs_file_aops.commit_write = gfs_commit_write; if (gfs_assert_warn(sdp, gfs_glock_is_locked_by_me(ip->i_gl))) return -ENOSYS; @@ -397,6 +397,7 @@ goto fail; } + ip->gfs_file_aops.commit_write = NULL; return 0; fail: