All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs:remove a no needed mutex_unlock in devtmpfs
Date: Fri, 29 Jul 2011 17:06:19 +0800	[thread overview]
Message-ID: <4E32780B.2090200@cn.fujitsu.com> (raw)
In-Reply-To: <4E327776.3010903@cn.fujitsu.com>

On 07/29/2011 05:03 PM, Li Zefan wrote:
> Wanlong Gao wrote:
>> According ed75e95de574c99575e5f3e1d9ca59ea8c12a9cb, Al killed the
>> lookup_create(), this function will return with an mutex locked,
>> and it called by dev_mkdir() previously. then unlock this mutex
>> in dev_mkdir(), but when lookup_create() is replaced by kern_path_create(),
>> no locked mutex returned, so no need to unlock the mutex.
>>
>> Al, is it right?
>
> no.. kern_path_create() returns with i_mutex held.
yeah, I hasn't seen the *return* when *dentry* is gotten successfully.
Sorry for the noise
>
>> Thanks
>>
>> Signed-off-by: Wanlong Gao<gaowanlong@cn.fujitsu.com>
>> ---
>>   drivers/base/devtmpfs.c |    1 -
>>   1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
>> index b89fffc..5384883 100644
>> --- a/drivers/base/devtmpfs.c
>> +++ b/drivers/base/devtmpfs.c
>> @@ -157,7 +157,6 @@ static int dev_mkdir(const char *name, mode_t mode)
>>   		/* mark as kernel-created inode */
>>   		dentry->d_inode->i_private =&thread;
>>   	dput(dentry);
>> -	mutex_unlock(&path.dentry->d_inode->i_mutex);
>>   	path_put(&path);
>>   	return err;
>>   }
>


-- 
Thanks
Best Regards
Wanlong Gao

      reply	other threads:[~2011-07-29  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  8:34 [PATCH] fs:remove a no needed mutex_unlock in devtmpfs Wanlong Gao
2011-07-29  9:02 ` Wanlong Gao
2011-07-29  9:03 ` Li Zefan
2011-07-29  9:06   ` Wanlong Gao [this message]

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=4E32780B.2090200@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.