linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 11/11] btrfs: use non-RCU list traversal in write_all_supers callees
Date: Mon, 6 Nov 2017 14:59:07 +0100	[thread overview]
Message-ID: <20171106135907.GE28789@suse.cz> (raw)
In-Reply-To: <f5d61e0d-b9b1-a34f-c3d2-3ba27ab4c448@suse.com>

On Thu, Nov 02, 2017 at 11:49:15AM +0200, Nikolay Borisov wrote:
> 
> 
> On 31.10.2017 19:44, David Sterba wrote:
> > We take the fs_devices::device_list_mutex mutex in write_all_supers
> > which will prevent any add/del changes to the device list. Therefore we
> > don't need to use the RCU variant list_for_each_entry_rcu in any of the
> > called functions.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> >  fs/btrfs/disk-io.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> > index efce9a2fa9be..042cf46e4cd0 100644
> > --- a/fs/btrfs/disk-io.c
> > +++ b/fs/btrfs/disk-io.c
> > @@ -3396,9 +3396,10 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
> >  	int errors_wait = 0;
> >  	blk_status_t ret;
> >  
> > +	WARN_ON(!mutex_is_locked(&info->fs_devices->device_list_mutex));
> 
> Don't we want lockdep_assert_held ? I'm assuming enough testing with
> lockdep on is performed so it will be caught in time if this invariant
> is broken.

Yes, lockdep_assert_held should enough, this is a development-time
warning. Will be fixed.

      reply	other threads:[~2017-11-06 14:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 17:44 [PATCH 00/11] Device fixes and cleanups David Sterba
2017-10-31 17:44 ` [PATCH 01/11] btrfs: add missing device::flush_bio puts David Sterba
2017-11-02  9:41   ` Nikolay Borisov
2017-11-06 13:24     ` David Sterba
2017-11-02 10:40   ` Anand Jain
2017-10-31 17:44 ` [PATCH 02/11] btrfs: rename device free rcu helper to free_device_rcu David Sterba
2017-10-31 17:44 ` [PATCH 03/11] btrfs: introduce free_device helper David Sterba
2017-10-31 17:44 ` [PATCH 04/11] btrfs: use free_device where opencoded David Sterba
2017-11-02 11:25   ` Anand Jain
2017-10-31 17:44 ` [PATCH 05/11] btrfs: simplify exit paths in btrfs_init_new_device David Sterba
2017-11-06  1:53   ` Anand Jain
2017-10-31 17:44 ` [PATCH 06/11] btrfs: document device locking David Sterba
2017-11-02 10:29   ` Nikolay Borisov
2017-11-06 13:51     ` David Sterba
2017-11-06 15:02       ` Nikolay Borisov
2017-11-06 15:09         ` David Sterba
2017-11-03 11:13   ` Anand Jain
2017-11-06  2:32     ` Anand Jain
2017-11-06 13:40       ` David Sterba
2017-11-06 13:36     ` David Sterba
2017-10-31 17:44 ` [PATCH 07/11] btrfs: dev_alloc_list is not protected by RCU, use normal list_del David Sterba
2017-10-31 17:44 ` [PATCH 08/11] btrfs: simplify btrfs_close_bdev David Sterba
2017-10-31 17:44 ` [PATCH 09/11] btrfs: switch to RCU for device traversal in btrfs_ioctl_dev_info David Sterba
2017-10-31 17:44 ` [PATCH 10/11] btrfs: switch to RCU for device traversal in btrfs_ioctl_fs_info David Sterba
2017-10-31 17:44 ` [PATCH 11/11] btrfs: use non-RCU list traversal in write_all_supers callees David Sterba
2017-11-02  9:49   ` Nikolay Borisov
2017-11-06 13:59     ` David Sterba [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=20171106135907.GE28789@suse.cz \
    --to=dsterba@suse.cz \
    --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
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).