All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Mitchell Blank Jr <mitch@sfgoth.com>,
	Al Viro <viro@ftp.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
Date: Thu, 04 Jan 2007 17:28:59 -0600	[thread overview]
Message-ID: <459D8DBB.10507@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0701041514470.3661@woody.osdl.org>

Linus Torvalds wrote:

> On Thu, 4 Jan 2007, Andrew Morton wrote:
>   
>> That's what I currently have queued.  It increases bad_inode.o text from 
>> 200-odd bytes to 700-odd :(
>>     
> Then I think we're ok. We do care about bytes, but we care more about 
> bytes that actually ever hit the icache or dcache, and this will 
> effectively do neither.
>
>   
Oh good.  Resolution?  ;-)

Andrew, if you stick with what you've got, you might want this on top of it.

Mostly cosmetic, making placement of * for pointers consistently " *foo"
not "* foo," (was a mishmash before, from cut-n-paste), but also making 
.poll return POLLERR.

Thanks,
-Eric

Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Index: linux-2.6.19/fs/bad_inode.c
===================================================================
--- linux-2.6.19.orig/fs/bad_inode.c
+++ linux-2.6.19/fs/bad_inode.c
@@ -46,18 +46,17 @@ static ssize_t bad_file_aio_write(struct
 	return -EIO;
 }
 
-static int bad_file_readdir(struct file * filp, void * dirent,
-			filldir_t filldir)
+static int bad_file_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
 	return -EIO;
 }
 
 static unsigned int bad_file_poll(struct file *filp, poll_table *wait)
 {
-	return -EIO;
+	return POLLERR;
 }
 
-static int bad_file_ioctl (struct inode * inode, struct file * filp,
+static int bad_file_ioctl (struct inode *inode, struct file *filp,
 			unsigned int cmd, unsigned long arg)
 {
 	return -EIO;
@@ -75,12 +74,12 @@ static long bad_file_compat_ioctl(struct
 	return -EIO;
 }
 
-static int bad_file_mmap(struct file * file, struct vm_area_struct * vma)
+static int bad_file_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	return -EIO;
 }
 
-static int bad_file_open(struct inode * inode, struct file * filp)
+static int bad_file_open(struct inode *inode, struct file *filp)
 {
 	return -EIO;
 }
@@ -90,12 +89,12 @@ static int bad_file_flush(struct file *f
 	return -EIO;
 }
 
-static int bad_file_release(struct inode * inode, struct file * filp)
+static int bad_file_release(struct inode *inode, struct file *filp)
 {
 	return -EIO;
 }
 
-static int bad_file_fsync(struct file * file, struct dentry *dentry,
+static int bad_file_fsync(struct file *file, struct dentry *dentry,
 			int datasync)
 {
 	return -EIO;
@@ -140,7 +139,7 @@ static int bad_file_check_flags(int flag
 	return -EIO;
 }
 
-static int bad_file_dir_notify(struct file * file, unsigned long arg)
+static int bad_file_dir_notify(struct file *file, unsigned long arg)
 {
 	return -EIO;
 }
@@ -194,54 +193,54 @@ static const struct file_operations bad_
 	.splice_read	= bad_file_splice_read,
 };
 
-static int bad_inode_create (struct inode * dir, struct dentry * dentry,
+static int bad_inode_create (struct inode *dir, struct dentry *dentry,
 		int mode, struct nameidata *nd)
 {
 	return -EIO;
 }
 
-static struct dentry *bad_inode_lookup(struct inode * dir,
+static struct dentry *bad_inode_lookup(struct inode *dir,
 			struct dentry *dentry, struct nameidata *nd)
 {
 	return ERR_PTR(-EIO);
 }
 
-static int bad_inode_link (struct dentry * old_dentry, struct inode * dir,
+static int bad_inode_link (struct dentry *old_dentry, struct inode *dir,
 		struct dentry *dentry)
 {
 	return -EIO;
 }
 
-static int bad_inode_unlink(struct inode * dir, struct dentry *dentry)
+static int bad_inode_unlink(struct inode *dir, struct dentry *dentry)
 {
 	return -EIO;
 }
 
-static int bad_inode_symlink (struct inode * dir, struct dentry *dentry,
-		const char * symname)
+static int bad_inode_symlink (struct inode *dir, struct dentry *dentry,
+		const char *symname)
 {
 	return -EIO;
 }
 
-static int bad_inode_mkdir(struct inode * dir, struct dentry * dentry,
+static int bad_inode_mkdir(struct inode *dir, struct dentry *dentry,
 			int mode)
 {
 	return -EIO;
 }
 
-static int bad_inode_rmdir (struct inode * dir, struct dentry *dentry)
+static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry)
 {
 	return -EIO;
 }
 
-static int bad_inode_mknod (struct inode * dir, struct dentry *dentry,
+static int bad_inode_mknod (struct inode *dir, struct dentry *dentry,
 			int mode, dev_t rdev)
 {
 	return -EIO;
 }
 
-static int bad_inode_rename (struct inode * old_dir, struct dentry *old_dentry,
-		struct inode * new_dir, struct dentry *new_dentry)
+static int bad_inode_rename (struct inode *old_dir, struct dentry *old_dentry,
+		struct inode *new_dir, struct dentry *new_dentry)
 {
 	return -EIO;
 }
@@ -337,7 +336,7 @@ static struct inode_operations bad_inode
  *	on it to fail from this point on.
  */
  
-void make_bad_inode(struct inode * inode) 
+void make_bad_inode(struct inode *inode) 
 {
 	remove_inode_hash(inode);
 
@@ -362,7 +361,7 @@ EXPORT_SYMBOL(make_bad_inode);
  *	Returns true if the inode in question has been marked as bad.
  */
  
-int is_bad_inode(struct inode * inode) 
+int is_bad_inode(struct inode *inode) 
 {
 	return (inode->i_op == &bad_inode_ops);	
 }



  reply	other threads:[~2007-01-04 23:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-03 23:46 [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values Eric Sandeen
2007-01-04  0:26 ` Andrew Morton
2007-01-04 17:51   ` Eric Sandeen
2007-01-04 18:26     ` Andrew Morton
2007-01-04 18:33       ` Eric Sandeen
2007-01-04 18:54         ` Andrew Morton
2007-01-04 19:09           ` Linus Torvalds
2007-01-04 19:14             ` Al Viro
2007-01-04 19:22               ` Al Viro
2007-01-04 19:32                 ` Linus Torvalds
2007-01-07  2:14                 ` Roman Zippel
2007-01-04 19:30               ` Linus Torvalds
2007-01-04 20:24                 ` Al Viro
2007-01-04 21:00                   ` Andrew Morton
2007-01-04 21:04                     ` Eric Sandeen
2007-01-04 21:10                       ` Andrew Morton
2007-01-04 21:18                         ` Eric Sandeen
2007-01-04 21:30                           ` Linus Torvalds
2007-01-04 21:50                             ` Eric Sandeen
2007-01-04 21:52                             ` Al Viro
2007-01-04 22:38                               ` Mitchell Blank Jr
2007-01-04 22:35                                 ` Linus Torvalds
2007-01-04 22:48                                   ` Eric Sandeen
2007-01-04 23:06                                   ` Andrew Morton
2007-01-04 23:17                                     ` Linus Torvalds
2007-01-04 23:28                                       ` Eric Sandeen [this message]
2007-01-04 23:21                                   ` Mitchell Blank Jr
2007-01-04 23:52                                     ` Al Viro
2007-01-05  5:59                                       ` Duplicated functions (was: fix memory corruption from misinterpreted bad_inode_ops return values) Mitchell Blank Jr
2007-01-05 15:40                                       ` [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values Arjan van de Ven
     [not found] <7zo1U-ht-9@gated-at.bofh.it>
     [not found] ` <7zoEG-1kW-19@gated-at.bofh.it>
     [not found]   ` <7zF2R-1wJ-33@gated-at.bofh.it>
     [not found]     ` <7zFvU-2p5-21@gated-at.bofh.it>
     [not found]       ` <7zFFr-2AP-1@gated-at.bofh.it>
     [not found]         ` <7zFYY-31i-19@gated-at.bofh.it>
     [not found]           ` <7zGie-3Ji-17@gated-at.bofh.it>
     [not found]             ` <7zGif-3Ji-21@gated-at.bofh.it>
     [not found]               ` <7zGBC-49g-39@gated-at.bofh.it>
     [not found]                 ` <7zHnX-5rJ-25@gated-at.bofh.it>
     [not found]                   ` <7zI0B-6x2-5@gated-at.bofh.it>
     [not found]                     ` <7zI0B-6x2-3@gated-at.bofh.it>
     [not found]                       ` <7zIak-6JF-15@gated-at.bofh.it>
     [not found]                         ` <7zIak-6JF-13@gated-at.bofh.it>
2007-01-05 16:33                           ` Bodo Eggert
  -- strict thread matches above, loose matches on Subject: below --
2007-01-04 19:23 Mikael Pettersson
2007-01-03 23:37 Eric Sandeen
2007-01-03 23:46 ` Eric Sandeen
2007-01-05 14:37 ` Phillip Lougher
2007-01-05 15:11   ` phillip

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=459D8DBB.10507@redhat.com \
    --to=sandeen@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitch@sfgoth.com \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    --cc=viro@zeniv.linux.org.uk \
    /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.