All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Frantisek Hrbata <fhrbata@redhat.com>
Cc: linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC] get_write_access()/deny_write_access() without inode->i_lock
Date: Mon, 20 Jun 2011 15:15:48 +0100	[thread overview]
Message-ID: <20110620141548.GS11521@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20110620132144.GB26576@dhcp-26-164.brq.redhat.com>

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...

  reply	other threads:[~2011-06-20 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19 23:51 [RFC] get_write_access()/deny_write_access() without inode->i_lock Al Viro
2011-06-20 12:47 ` David Howells
2011-06-20 13:18   ` Al Viro
2011-06-20 13:20   ` David Howells
2011-06-20 13:20     ` David Howells
2011-06-20 13:21 ` Frantisek Hrbata
2011-06-20 14:15   ` Al Viro [this message]
2011-06-20 15:55 ` Linus Torvalds
2011-06-20 15:55   ` Linus Torvalds
2011-06-20 16:13   ` Al Viro
2011-06-20 16:22     ` Linus Torvalds
2011-06-20 16:42       ` Al Viro
2011-06-20 17:03         ` Al Viro
2011-06-20 19:47 ` Andi Kleen

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=20110620141548.GS11521@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=fhrbata@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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.