All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op ...
Date: 10 Oct 2006 18:35:28 -0000	[thread overview]
Message-ID: <20061010183528.27654.qmail@sourceware.org> (raw)

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;



             reply	other threads:[~2006-10-10 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 18:35 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-02 17:21 [Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op rpeterso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061010183528.27654.qmail@sourceware.org \
    --to=rpeterso@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.