[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8763d4ivi5.fsf@devron.myhome.or.jp>
Date: Tue, 04 Aug 2009 03:48:34 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: Dave Hansen <dave@...ux.vnet.ibm.com>
Cc: Al Viro <viro@...iv.linux.org.uk>, Nick Piggin <npiggin@...e.de>,
linux-kernel@...r.kernel.org
Subject: Re: mnt_want_write_file() has problem?
Dave Hansen <dave@...ux.vnet.ibm.com> writes:
> On Mon, 2009-08-03 at 06:36 +0900, OGAWA Hirofumi wrote:
>> While I'm reading some code, I suspected that mnt_want_write_file() may
>> have wrong assumption. I think mnt_want_write_file() is assuming it
>> increments ->mnt_writers if (file->f_mode & FMODE_WRITE). But, if it's
>> special_file(), it is false?
>>
>> Sorry, I'm still not checking all of those though. E.g. I'm thinking the
>> below.
>>
>> static inline int __get_file_write_access(struct inode *inode,
>> struct vfsmount *mnt)
>> {
>> [...]
>> if (!special_file(inode->i_mode)) {
>> /*
>> * Balanced in __fput()
>> */
>> error = mnt_want_write(mnt);
>> if (error)
>> put_write_access(inode);
>> }
>> return error;
>> }
>
> In practice I don't think this is an issue. We were never supposed to
> do mnt_want_write(mnt) for any 'struct file' that was a special_file(),
> specifically because of what you mention.
>
> Nick's use of mnt_want_write_file() was a 1:1 drop-in for
> mnt_want_write(). So, if all is well in the world, there should not be
> any call sites where mnt_want_write_file() gets called on a
> special_file().
void file_update_time(struct file *file)
sys_fchmod()
sys_fchown()
sys_fsetxattr()
sys_fremovexattr()
Um..., the users of mnt_want_write_file() seems to be those. I think
all of those filp can be special file?
Thanks.
--
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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