From ef20c8c197df9b8d5bd4af0679123826da028861 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Feb 2006 15:41:50 -0500 Subject: [PATCH] GFP_KERNEL allocations in atomic (auditsc) audit_log_exit() is called from atomic contexts and gets explicit gfp_mask argument; it should use it for all allocations rather than doing some with gfp_mask and some with GFP_KERNEL. Signed-off-by: Al Viro diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 685c251..d7e7e63 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -841,7 +841,7 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask) for (aux = context->aux; aux; aux = aux->next) { - ab = audit_log_start(context, GFP_KERNEL, aux->type); + ab = audit_log_start(context, gfp_mask, aux->type); if (!ab) continue; /* audit_panic has been called */ @@ -878,14 +878,14 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask) } if (context->pwd && context->pwdmnt) { - ab = audit_log_start(context, GFP_KERNEL, AUDIT_CWD); + ab = audit_log_start(context, gfp_mask, AUDIT_CWD); if (ab) { audit_log_d_path(ab, "cwd=", context->pwd, context->pwdmnt); audit_log_end(ab); } } for (i = 0; i < context->name_count; i++) { - ab = audit_log_start(context, GFP_KERNEL, AUDIT_PATH); + ab = audit_log_start(context, gfp_mask, AUDIT_PATH); if (!ab) continue; /* audit_panic has been called */ -- cgit v0.10.2 From e30809fde59d591809f00caa1a4c960cca5916af Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 8 Feb 2006 14:09:00 -0500 Subject: [PATCH] don't mangle INQUIRY if cmddt or evpd bits are set sbp2.c mangles INQUIRY response in a way that only applies to standard inquiry data (i.e. when both cmddt and evpd bits are 0). Leave other cases alone; e.g. when asking for VPD the length of reply is in byte 3, not 4 and byte 4 is the first byte of device serial number. Signed-off-by: Al Viro diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 18d7eda..c2c776f 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -2082,9 +2082,7 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id, SBP2_DEBUG("sbp2_check_sbp2_response"); - switch (SCpnt->cmnd[0]) { - - case INQUIRY: + if (SCpnt->cmnd[0] == INQUIRY && (SCpnt->cmnd[1] & 3) == 0) { /* * Make sure data length is ok. Minimum length is 36 bytes */ @@ -2097,13 +2095,7 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id, */ scsi_buf[2] |= 2; scsi_buf[3] = (scsi_buf[3] & 0xf0) | 2; - - break; - - default: - break; } - return; } /* -- cgit v0.10.2 From 76b6159ba094544e003a237cedcf555d82fa3bfe Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 8 Feb 2006 14:37:40 -0500 Subject: [PATCH] fix handling of st_nlink on procfs root 1) it should use nr_processes(), not nr_threads; otherwise we are getting very confused find(1) and friends, among other things. 2) better do that at stat() time than at every damn lookup in procfs root. Patch had been sitting in FC4 kernels for many months now... Signed-off-by: Al Viro diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 6573f31..075d3e9 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -204,10 +204,6 @@ int proc_fill_super(struct super_block *s, void *data, int silent) root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); if (!root_inode) goto out_no_root; - /* - * Fixup the root inode's nlink value - */ - root_inode->i_nlink += nr_processes(); root_inode->i_uid = 0; root_inode->i_gid = 0; s->s_root = d_alloc_root(root_inode); diff --git a/fs/proc/root.c b/fs/proc/root.c index 6889628..c3fd361 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -80,16 +80,16 @@ void __init proc_root_init(void) proc_bus = proc_mkdir("bus", NULL); } -static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) +static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat +) { - /* - * nr_threads is actually protected by the tasklist_lock; - * however, it's conventional to do reads, especially for - * reporting, without any locking whatsoever. - */ - if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */ - dir->i_nlink = proc_root.nlink + nr_threads; + generic_fillattr(dentry->d_inode, stat); + stat->nlink = proc_root.nlink + nr_processes(); + return 0; +} +static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) +{ if (!proc_lookup(dir, dentry, nd)) { return NULL; } @@ -134,6 +134,7 @@ static struct file_operations proc_root_operations = { */ static struct inode_operations proc_root_inode_operations = { .lookup = proc_root_lookup, + .getattr = proc_root_getattr, }; /* -- cgit v0.10.2 From 00fc00df9e7b637cd13fe1f163da0a2957273947 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 18 Jan 2006 21:22:55 -0500 Subject: [PATCH] m68k: restore disable_irq_nosync() Patch claiming to remove enable_irq_nosync() had left it alive but killed disable_irq_nosync() instead... Signed-off-by: Al Viro diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 325c86f..9ac047c 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -79,7 +79,7 @@ static __inline__ int irq_canonicalize(int irq) extern void (*enable_irq)(unsigned int); extern void (*disable_irq)(unsigned int); -#define enable_irq_nosync enable_irq +#define disable_irq_nosync disable_irq struct pt_regs; -- cgit v0.10.2 From cc6cdac0cf11955dc81d6c50b6738d05e1dca12b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Feb 2006 16:02:18 -0500 Subject: [PATCH] missing ntohs() in ip6_tunnel ->payload_len is net-endian Signed-off-by: Al Viro diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 92ead3c..faea8a1 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -458,7 +458,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, mtu = IPV6_MIN_MTU; t->dev->mtu = mtu; - if ((len = sizeof (*ipv6h) + ipv6h->payload_len) > mtu) { + if ((len = sizeof (*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { rel_type = ICMPV6_PKT_TOOBIG; rel_code = 0; rel_info = mtu; -- cgit v0.10.2 From cead14da59fc261534fa749886c12c16757711fd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 18 Jan 2006 19:41:35 -0500 Subject: [PATCH] m68k: pm_power_off() breakage Signed-off-by: Al Viro diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 3f9cb55..2d8ad07 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -129,6 +129,9 @@ void machine_power_off(void) for (;;); } +void (*pm_power_off)(void) = machine_power_off; +EXPORT_SYMBOL(pm_power_off); + void show_regs(struct pt_regs * regs) { printk("\n"); -- cgit v0.10.2 From ad6b97fc929e5844bfd1d708ab1d74d131d7960d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 3 Feb 2006 02:06:42 -0500 Subject: [PATCH] iomap_copy fallout (m68k) added __raw_writel(), sanitized include order in iomap_copy.c Signed-off-by: Al Viro diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h index 5439bca..811ccd2 100644 --- a/include/asm-m68k/raw_io.h +++ b/include/asm-m68k/raw_io.h @@ -336,6 +336,7 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, : "d0", "a0", "a1", "d6"); } +#define __raw_writel raw_outl #endif /* __KERNEL__ */ diff --git a/lib/iomap_copy.c b/lib/iomap_copy.c index a6b1e27..351045f 100644 --- a/lib/iomap_copy.c +++ b/lib/iomap_copy.c @@ -15,8 +15,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include +#include /** * __iowrite32_copy - copy data to MMIO space, in 32-bit units -- cgit v0.10.2