[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1249413319.11056.131.camel@nimitz>
Date: Tue, 04 Aug 2009 12:15:19 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc: Al Viro <viro@...iv.linux.org.uk>, Nick Piggin <npiggin@...e.de>,
linux-kernel@...r.kernel.org, akpm <akpm@...uxfoundation.org>
Subject: Re: mnt_want_write_file() has problem?
On Mon, 2009-08-03 at 06:36 +0900, OGAWA Hirofumi wrote:
> diff -puN fs/namespace.c~mnt_want_write-wrong-assume fs/namespace.c
> ---
> linux-2.6/fs/namespace.c~mnt_want_write-wrong-assume 2009-08-03
> 04:33:35.000000000 +0900
> +++ linux-2.6-hirofumi/fs/namespace.c 2009-08-03 04:31:34.000000000
> +0900
> @@ -316,7 +316,8 @@ EXPORT_SYMBOL_GPL(mnt_clone_write);
> */
> int mnt_want_write_file(struct file *file)
> {
> - if (!(file->f_mode & FMODE_WRITE))
> + struct inode *inode = file->f_dentry->d_inode;
> + if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
> return mnt_want_write(file->f_path.mnt);
> else
> return mnt_clone_write(file->f_path.mnt);
I'm fine with this. I'd like a debugging check in mnt_clone_write()
since this bug is easy to detect, but such a check will also cost all of
the performance gains that Nick added. So, we can't have it
unconditionally.
--
Signed-off-by: Dave Hansen <dave@...ux.vnet.ibm.com>
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists