* [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op ...
@ 2006-08-02 17:21 rpeterso
0 siblings, 0 replies; 2+ messages in thread
From: rpeterso @ 2006-08-02 17:21 UTC (permalink / raw)
To: cluster-devel.redhat.com
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:
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op ...
@ 2006-10-10 18:35 rpeterso
0 siblings, 0 replies; 2+ messages in thread
From: rpeterso @ 2006-10-10 18:35 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rpeterso at sourceware.org 2006-10-10 18:35:28
Modified files:
gfs-kernel/src/gfs: incore.h inode.c ops_address.c ops_inode.c
Log message:
Fix for bugzilla bug 164499: Unable to mount loopback images
from mounted GFS partition.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/incore.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.17.2.6&r2=1.17.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.20.2.2&r2=1.20.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_address.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.5&r2=1.5.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_inode.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.3&r2=1.6.2.4
--- cluster/gfs-kernel/src/gfs/incore.h 2006/09/15 21:42:05 1.17.2.6
+++ cluster/gfs-kernel/src/gfs/incore.h 2006/10/10 18:35:27 1.17.2.7
@@ -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 2005/08/16 17:10:41 1.20.2.2
+++ cluster/gfs-kernel/src/gfs/inode.c 2006/10/10 18:35:27 1.20.2.3
@@ -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/02/20 15:34:05 1.5.2.5
+++ cluster/gfs-kernel/src/gfs/ops_address.c 2006/10/10 18:35:27 1.5.2.6
@@ -32,6 +32,8 @@
#include "quota.h"
#include "trans.h"
+static int gfs_commit_write(struct file *file, struct page *page,
+ unsigned from, unsigned to);
/**
* get_block - Fills in a buffer head with details about a block
* @inode: The inode
@@ -327,6 +329,13 @@
atomic_inc(&sdp->sd_ops_address);
+ /* We can't set commit_write in the structure in the declare */
+ /* because if we do, loopback (loop.c) will interpret that to mean */
+ /* 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. */
+ 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;
@@ -395,6 +404,7 @@
goto fail;
}
+ ip->gfs_file_aops.commit_write = NULL;
return 0;
fail:
@@ -473,7 +483,6 @@
.readpage = gfs_readpage,
.sync_page = block_sync_page,
.prepare_write = gfs_prepare_write,
- .commit_write = gfs_commit_write,
.bmap = gfs_bmap,
.direct_IO = gfs_direct_IO,
};
--- cluster/gfs-kernel/src/gfs/ops_inode.c 2006/04/20 22:30:14 1.6.2.3
+++ cluster/gfs-kernel/src/gfs/ops_inode.c 2006/10/10 18:35:27 1.6.2.4
@@ -952,7 +952,7 @@
return 0;
}
- /* Make sure we aren't trying to move a dirctory into it's subdir */
+ /* Make sure we aren't trying to move a directory into its subdir */
if (ip->i_di.di_type == GFS_FILE_DIR && odip != ndip) {
dir_rename = TRUE;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-10 18:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 18:35 [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op rpeterso
-- strict thread matches above, loose matches on Subject: below --
2006-08-02 17:21 rpeterso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).