All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitri Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: Fix possible chmod/truncate race condition.
Date: Sun, 26 Oct 2008 20:37:13 -0700	[thread overview]
Message-ID: <20081026203713.c00e69db.akpm@linux-foundation.org> (raw)
In-Reply-To: <m33aixy7ls.fsf@dmon-lap.sw.ru>

On Wed, 15 Oct 2008 23:35:27 +0400 Dmitri Monakhov <dmonakhov@openvz.org> wrote:

> 
> Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org>
> ---
>  fs/open.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/open.c b/fs/open.c
> index 07da935..3423b94 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -214,10 +214,9 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
>  		newattrs.ia_valid |= ATTR_FILE;
>  	}
>  
> +	mutex_lock(&dentry->d_inode->i_mutex);
>  	/* Remove suid/sgid on truncate too */
>  	newattrs.ia_valid |= should_remove_suid(dentry);
> -
> -	mutex_lock(&dentry->d_inode->i_mutex);
>  	err = notify_change(dentry, &newattrs);
>  	mutex_unlock(&dentry->d_inode->i_mutex);
>  	return err;

OK, I give up.  What race?

  reply	other threads:[~2008-10-27  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-15 19:35 [PATCH] vfs: Fix possible chmod/truncate race condition Dmitri Monakhov
2008-10-27  3:37 ` Andrew Morton [this message]
2008-10-27  7:57   ` Dmitri Monakhov

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=20081026203713.c00e69db.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dmonakhov@openvz.org \
    --cc=linux-kernel@vger.kernel.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.