From 94a2f84b27b47a7a306c9928003191214b57a753 Mon Sep 17 00:00:00 2001
From: Marc Fiuczynski <mef@cs.princeton.edu>
Date: Fri, 21 Jan 2005 03:34:20 +0000
Subject: [PATCH] fedora 2.6.8 1.521

---
 .config                              |  5 ++---
 .config.old                          |  4 ++--
 arch/ppc64/mm/Makefile               |  2 +-
 configs/kernel-2.6.8-i586-smp.config |  5 ++---
 configs/kernel-2.6.8-i586.config     |  5 ++---
 configs/kernel-2.6.8-i686-smp.config |  5 ++---
 configs/kernel-2.6.8-i686.config     |  5 ++---
 drivers/block/scsi_ioctl.c           |  1 -
 drivers/net/Kconfig                  |  1 +
 drivers/scsi/ide-scsi.c              |  2 +-
 fs/nfs/file.c                        |  4 ++--
 include/asm-ppc64/processor.h        |  2 ++
 include/linux/autoconf.h             |  5 ++---
 kernel/sysctl.c                      |  2 +-
 net/sched/sch_api.c                  | 21 +++++++++++++--------
 15 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/.config b/.config
index e1fd9cb2d..3349989f0 100644
--- a/.config
+++ b/.config
@@ -937,9 +937,8 @@ CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_ACT=y
-# CONFIG_NET_ACT_POLICE is not set
-# CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
diff --git a/.config.old b/.config.old
index 462e5986d..19b251938 100644
--- a/.config.old
+++ b/.config.old
@@ -827,11 +827,11 @@ CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-# CONFIG_NET_CLS_POLICE is not set
+CONFIG_NET_CLS_POLICE=y
 # CONFIG_NET_ACT_POLICE is not set
 CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
-CONFIG_NET_CLS_ACT=y
+# CONFIG_NET_CLS_ACT is not set
 
 #
 # Network testing
diff --git a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile
index 0306babff..691b25e43 100644
--- a/arch/ppc64/mm/Makefile
+++ b/arch/ppc64/mm/Makefile
@@ -4,6 +4,6 @@
 
 EXTRA_CFLAGS += -mno-minimal-toc
 
-obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o slb_low.o slb.o
+obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o slb_low.o slb.o mmap.o
 obj-$(CONFIG_DISCONTIGMEM) += numa.o
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/configs/kernel-2.6.8-i586-smp.config b/configs/kernel-2.6.8-i586-smp.config
index 31d193e4d..7a0cf3d1e 100644
--- a/configs/kernel-2.6.8-i586-smp.config
+++ b/configs/kernel-2.6.8-i586-smp.config
@@ -944,9 +944,8 @@ CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_ACT=y
-# CONFIG_NET_ACT_POLICE is not set
-# CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
diff --git a/configs/kernel-2.6.8-i586.config b/configs/kernel-2.6.8-i586.config
index d2ffd4331..fa9b74e3c 100644
--- a/configs/kernel-2.6.8-i586.config
+++ b/configs/kernel-2.6.8-i586.config
@@ -936,9 +936,8 @@ CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_ACT=y
-# CONFIG_NET_ACT_POLICE is not set
-# CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
diff --git a/configs/kernel-2.6.8-i686-smp.config b/configs/kernel-2.6.8-i686-smp.config
index 5075ca71a..1c85fe62e 100644
--- a/configs/kernel-2.6.8-i686-smp.config
+++ b/configs/kernel-2.6.8-i686-smp.config
@@ -948,9 +948,8 @@ CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_ACT=y
-# CONFIG_NET_ACT_POLICE is not set
-# CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
diff --git a/configs/kernel-2.6.8-i686.config b/configs/kernel-2.6.8-i686.config
index e1fd9cb2d..3349989f0 100644
--- a/configs/kernel-2.6.8-i686.config
+++ b/configs/kernel-2.6.8-i686.config
@@ -937,9 +937,8 @@ CONFIG_CLS_U32_PERF=y
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_ACT=y
-# CONFIG_NET_ACT_POLICE is not set
-# CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index bcd0935bd..f94fd8adf 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -154,7 +154,6 @@ static int verify_command(struct file *file, unsigned char *cmd)
 		safe_for_write(WRITE_12),
 		safe_for_write(WRITE_VERIFY_12),
 		safe_for_write(WRITE_16),
-		safe_for_write(WRITE_BUFFER),
 		safe_for_write(WRITE_LONG),
 	};
 	unsigned char type = cmd_type[cmd[0]];
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 681b8c9d9..b124144a9 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1075,6 +1075,7 @@ config ETH16I
 
 config NE2000
 	tristate "NE2000/NE1000 support"
+	depends on ISA || (Q40 && m)
 	select CRC32
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 5abf53eee..2d05c1461 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -725,7 +725,7 @@ static int idescsi_ide_open(struct inode *inode, struct file *filp)
 	drive->usage++;
 	if (!ide_scsi_warned++) {
 		printk(KERN_WARNING "ide-scsi: Warning this device driver is only intended for specialist devices.\n");
-		printk(KERN_WARNING "ide-scsi: Do not use for cd burning, use /dev/hdc directly instead.\n");
+		printk(KERN_WARNING "ide-scsi: Do not use for cd burning, use /dev/hdX directly instead.\n");
 	}
 	return 0;
 }
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index ee2addb5c..6d9150de8 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -72,7 +72,7 @@ struct inode_operations nfs_file_inode_operations = {
 
 static int nfs_check_flags(int flags)
 {
-	if (flags & (O_APPEND | O_DIRECT))
+	if ((flags & (O_APPEND | O_DIRECT)) == (O_APPEND | O_DIRECT))
 		return -EINVAL;
 
 	return 0;
@@ -89,7 +89,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
 	int res;
 
 	res = nfs_check_flags(filp->f_flags);
-	if (!res)
+	if (res)
 		return res;
 
 	lock_kernel();
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index d5e383732..037801119 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -633,6 +633,8 @@ static inline void prefetchw(const void *x)
 
 #endif /* ASSEMBLY */
 
+#define HAVE_ARCH_PICK_MMAP_LAYOUT
+
 /*
  * Number of entries in the SLB. If this ever changes we should handle
  * it with a use a cpu feature fixup.
diff --git a/include/linux/autoconf.h b/include/linux/autoconf.h
index 30079e819..9c9448e2f 100644
--- a/include/linux/autoconf.h
+++ b/include/linux/autoconf.h
@@ -938,9 +938,8 @@
 #define CONFIG_NET_CLS_IND 1
 #define CONFIG_NET_CLS_RSVP_MODULE 1
 #define CONFIG_NET_CLS_RSVP6_MODULE 1
-#define CONFIG_NET_CLS_ACT 1
-#undef CONFIG_NET_ACT_POLICE
-#undef CONFIG_NET_CLS_POLICE
+#undef CONFIG_NET_CLS_ACT
+#define CONFIG_NET_CLS_POLICE 1
 
 /*
  * Network testing
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 26132ca0d..5c03cee8a 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -348,7 +348,7 @@ static ctl_table kern_table[] = {
 		.procname	= "tainted",
 		.data		= &tainted,
 		.maxlen		= sizeof(int),
-		.mode		= 0644,
+		.mode		= 0444,
 		.proc_handler	= &proc_dointvec,
 	},
 	{
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 1f9bf9d08..19ff1b9e3 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -389,7 +389,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 {
 	int err;
 	struct rtattr *kind = tca[TCA_KIND-1];
-	struct Qdisc *sch = NULL;
+	void *p = NULL;
+	struct Qdisc *sch;
 	struct Qdisc_ops *ops;
 	int size;
 
@@ -407,12 +408,18 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 	if (ops == NULL)
 		goto err_out;
 
-	size = sizeof(*sch) + ops->priv_size;
+	/* ensure that the Qdisc and the private data are 32-byte aligned */
+	size = ((sizeof(*sch) + QDISC_ALIGN_CONST) & ~QDISC_ALIGN_CONST);
+	size += ops->priv_size + QDISC_ALIGN_CONST;
 
-	sch = kmalloc(size, GFP_KERNEL);
+	p = kmalloc(size, GFP_KERNEL);
 	err = -ENOBUFS;
-	if (!sch)
+	if (!p)
 		goto err_out;
+	memset(p, 0, size);
+	sch = (struct Qdisc *)(((unsigned long)p + QDISC_ALIGN_CONST)
+	                       & ~QDISC_ALIGN_CONST);
+	sch->padded = (char *)sch - (char *)p;
 
 	/* Grrr... Resolve race condition with module unload */
 
@@ -420,8 +427,6 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 	if (ops != qdisc_lookup_ops(kind))
 		goto err_out;
 
-	memset(sch, 0, size);
-
 	INIT_LIST_HEAD(&sch->list);
 	skb_queue_head_init(&sch->q);
 
@@ -470,8 +475,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 
 err_out:
 	*errp = err;
-	if (sch)
-		kfree(sch);
+	if (p)
+		kfree(p);
 	return NULL;
 }
 
-- 
2.47.0