Re: [RFC] get_write_access()/deny_write_access() without inode->i_lock
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: 2011-06-20 14:15:48
Also in:
linux-fsdevel, lkml
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: 2011-06-20 14:15:48
Also in:
linux-fsdevel, lkml
On Mon, Jun 20, 2011 at 03:21:44PM +0200, Frantisek Hrbata wrote:
quoted
+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...