linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Anand Jain <anand.jain@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/5] btrfs: fix comment its device list mutex not volume lock
Date: Fri, 8 Feb 2019 09:19:51 +0200	[thread overview]
Message-ID: <8bcd64cd-051e-f2b7-8687-b52303d8ad0f@suse.com> (raw)
In-Reply-To: <ffce7d69-8072-99fd-e489-6751cf50928f@oracle.com>



On 8.02.19 г. 9:16 ч., Anand Jain wrote:
> 
> 
> On 2/8/19 3:07 PM, Nikolay Borisov wrote:
>>
>>
>> On 8.02.19 г. 9:02 ч., Anand Jain wrote:
>>> We have killed volume mutex (commit: dccdb07bc996
>>> btrfs: kill btrfs_fs_info::volume_mutex) update comment. This a
>>> trival one
>>> seems to have escaped.
>>>
>>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>>> ---
>>>   fs/btrfs/volumes.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>>> index fe122e6099ae..8160749cd9ba 100644
>>> --- a/fs/btrfs/volumes.c
>>> +++ b/fs/btrfs/volumes.c
>>> @@ -1129,7 +1129,7 @@ static struct btrfs_fs_devices
>>> *clone_fs_devices(struct btrfs_fs_devices *orig)
>>>       mutex_lock(&orig->device_list_mutex);
>>>       fs_devices->total_devices = orig->total_devices;
>>>   -    /* We have held the volume lock, it is safe to get the
>>> devices. */
>>> +    /* We have held the device_list_mutex, it is safe to get the
>>> devices. */
>>
>> I'd rather have the comment replaced with lockdep_assert_held it's a lot
>> more eloquent.
> 
>   I agree if we don't acquire the required lock in the same function,
>   but here, we call the required mutex_lock(&orig->device_list_mutex);
>   just three lines above in the same function.
> 
>   Where do we need the lockdep_assert_held()?

You are right I missed that. In that case I'd say just remove the
comment it should be obvious what's happening.

> 
> -Anand
> 
>>>       list_for_each_entry(orig_dev, &orig->devices, dev_list) {
>>>           struct rcu_string *name;
>>>  
> 

  reply	other threads:[~2019-02-08  7:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  7:02 [PATCH 0/5] Misc props.c cleanups Anand Jain
2019-02-08  7:02 ` [PATCH 1/5] btrfs: fix comment its device list mutex not volume lock Anand Jain
2019-02-08  7:07   ` Nikolay Borisov
2019-02-08  7:16     ` Anand Jain
2019-02-08  7:19       ` Nikolay Borisov [this message]
2019-02-08  7:39         ` [PATCH v2 " Anand Jain
2019-02-11 18:41           ` David Sterba
2019-02-08  7:02 ` [PATCH 2/5] btrfs: kill __btrfs_set_prop() Anand Jain
2019-02-08  7:02 ` [PATCH 3/5] btrfs: reorg functions to drop forward declaration Anand Jain
2019-02-08  7:10   ` Nikolay Borisov
2019-02-11 18:43     ` David Sterba
2019-02-08  7:02 ` [PATCH 4/5] btrfs: drop redundant forward declaration in props.c Anand Jain
2019-02-08  7:09   ` Nikolay Borisov
2019-02-08  7:02 ` [PATCH 5/5] btrfs: trivial, fix c coding style Anand Jain
2019-02-08  7:09   ` Nikolay Borisov
2019-02-08  7:15 ` [PATCH 0/5] Misc props.c cleanups Nikolay Borisov
2019-02-08  7:31   ` Anand Jain

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=8bcd64cd-051e-f2b7-8687-b52303d8ad0f@suse.com \
    --to=nborisov@suse.com \
    --cc=anand.jain@oracle.com \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).