cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH v6 1/2] blktrace: Fix potentail deadlock between delete & sysfs ops
Date: Tue, 19 Sep 2017 07:38:11 -0700	[thread overview]
Message-ID: <20170919143811.GB15944@infradead.org> (raw)
In-Reply-To: <aaa854ce-3e87-2a71-5f12-08db9bfbe837@redhat.com>

On Tue, Sep 19, 2017 at 08:49:12AM -0400, Waiman Long wrote:
> On 09/18/2017 08:01 PM, Christoph Hellwig wrote:
> > Taking a look at this it seems like using a lock in struct block_device
> > isn't the right thing to do anyway - all the action is on fields in
> > struct blk_trace, so having a lock inside that would make a lot more
> > sense.
> >
> > It would also help to document what exactly we're actually protecting.
> 
> I think I documented in the patch that the lock has to protect changes
> in the blktrace structure as well as the allocation and destruction of
> it. Because of that, it can't be put inside the blktrace structure. The
> original code use the bd_mutex of the block_device structure. I just
> change the code to use another bd_fsfreeze_mutex in the same structure.

Either way it has absolutely nothing to do with struct block_device,
given that struct blk_trace hangs off the request_queue.

Reusing a mutex just because it happens to live in a structure also
generally is a bad idea if the protected data is in no way related.



  reply	other threads:[~2017-09-19 14:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 18:53 [Cluster-devel] [PATCH v6 0/2] blktrace: Fix deadlock problem Waiman Long
2017-09-18 18:53 ` [Cluster-devel] [PATCH v6 1/2] blktrace: Fix potentail deadlock between delete & sysfs ops Waiman Long
2017-09-19  0:01   ` Christoph Hellwig
2017-09-19 12:49     ` Waiman Long
2017-09-19 14:38       ` Christoph Hellwig [this message]
2017-09-19 15:58         ` Waiman Long
2017-09-19 20:41           ` Christoph Hellwig
2017-09-19 21:58             ` Steven Rostedt
2017-09-18 18:53 ` [Cluster-devel] [PATCH v6 2/2] block_dev: Rename bd_fsfreeze_mutex Waiman Long
2017-09-18 23:47   ` Christoph Hellwig
2017-09-19 12:43     ` Waiman Long
2017-09-18 21:14 ` [Cluster-devel] [PATCH v6 0/2] blktrace: Fix deadlock problem Steven Rostedt

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=20170919143811.GB15944@infradead.org \
    --to=hch@infradead.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).