[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110620141548.GS11521@ZenIV.linux.org.uk>
Date: Mon, 20 Jun 2011 15:15:48 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Frantisek Hrbata <fhrbata@...hat.com>
Cc: linux-arch@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC] get_write_access()/deny_write_access() without
inode->i_lock
On Mon, Jun 20, 2011 at 03:21:44PM +0200, Frantisek Hrbata wrote:
> > +static inline int deny_write_access(struct file *file)
> > +{
> > + struct inode *inode = file->f_path.dentry->d_inode;
> > + int v, v1;
> > + for (v = atomic_read(&inode->i_writecount); v <= 0; v = v1) {
> > + v1 = atomic_cmpxchg(&inode->i_writecount, v, v + 1);
> ^^^^^
> Shouldn't i_writecount be decreased here. Looks like cut & paste problem to
> me.
Yes, it should and yes, it is. Thanks for spotting...
--
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