Thread (22 messages) flat view 22 messages, 13 authors, 2007-02-08

Re: patches in powerpc.git

From: Stephen Rothwell <hidden>
Date: 2007-02-07 23:42:06

On Wed, 07 Feb 2007 10:38:30 -0600 Will Schmidt [off-list ref] wrote:
On Wed, 2007-07-02 at 15:55 +1100, Stephen Rothwell wrote:
quoted
On Wed, 7 Feb 2007 15:03:13 +1100 Paul Mackerras [off-list ref] wrote:
quoted
If anyone has patches not listed here that they want in 2.6.21, please
let me or the relevant sub-arch maintainer know.
How about "Fix ppc64's writing to struct file_operations" sent to you
yesterday by Andrew Morton.
Is this the lparcfg fops .write changes that came across LKML
mid-January?    I didnt notice any references to it here.. 
Yep.  Copy below.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Subject: [patch 03/10] Fix ppc64's writing to struct file_operations
To: paulus@samba.org
Cc: benh@kernel.crashing.org, akpm@linux-foundation.org, sfr@canb.auug.org.au,
   arjan@infradead.org
From: akpm@linux-foundation.org
Date: Mon, 05 Feb 2007 16:14:05 -0800

From: Stephen Rothwell <redacted>

In preparation for marking file_operations as const.

Cc: Paul Mackerras <redacted>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Arjan van de Ven <redacted>
Signed-off-by: Stephen Rothwell <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/kernel/lparcfg.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff -puN arch/powerpc/kernel/lparcfg.c~fix-ppc64s-writing-to-struct-file_operations arch/powerpc/kernel/lparcfg.c
--- a/arch/powerpc/kernel/lparcfg.c~fix-ppc64s-writing-to-struct-file_operations
+++ a/arch/powerpc/kernel/lparcfg.c
@@ -439,6 +439,10 @@ static ssize_t lparcfg_write(struct file
 
 	ssize_t retval = -ENOMEM;
 
+	if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
+			firmware_has_feature(FW_FEATURE_ISERIES))
+		return -EINVAL;
+
 	kbuf = kmalloc(count, GFP_KERNEL);
 	if (!kbuf)
 		goto out;
@@ -517,7 +521,7 @@ static int pseries_lparcfg_data(struct s
 static ssize_t lparcfg_write(struct file *file, const char __user * buf,
 			     size_t count, loff_t * off)
 {
-	return count;
+	return -EINVAL;
 }
 
 #endif				/* CONFIG_PPC_PSERIES */
@@ -570,6 +574,7 @@ static int lparcfg_open(struct inode *in
 struct file_operations lparcfg_fops = {
 	.owner		= THIS_MODULE,
 	.read		= seq_read,
+	.write		= lparcfg_write,
 	.open		= lparcfg_open,
 	.release	= single_release,
 };
@@ -581,10 +586,8 @@ int __init lparcfg_init(void)
 
 	/* Allow writing if we have FW_FEATURE_SPLPAR */
 	if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
-			!firmware_has_feature(FW_FEATURE_ISERIES)) {
-		lparcfg_fops.write = lparcfg_write;
+			!firmware_has_feature(FW_FEATURE_ISERIES))
 		mode |= S_IWUSR;
-	}
 
 	ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
 	if (ent) {
_
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help