Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.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 15:16:36 +0800
Message-ID: <ffce7d69-8072-99fd-e489-6751cf50928f@oracle.com> (raw)
In-Reply-To: <b4404ffe-12f8-0f3f-672d-4eb23291b710@suse.com>



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()?

-Anand

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

  reply index

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 [this message]
2019-02-08  7:19       ` Nikolay Borisov
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 publically 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=ffce7d69-8072-99fd-e489-6751cf50928f@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox