Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735965

Re: [PATCH v7] blktrace: Fix potentail deadlock between delete & sysfs ops

From Christoph Hellwig <hch@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v7] blktrace: Fix potentail deadlock between delete & sysfs ops
Date 2017-09-20 19:40 +0200
Message-ID <urR8C-67N-21@gated-at.bofh.it> (permalink)
References <urQYX-63Y-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +/*
> + * When reading or writing the blktrace sysfs files, the references to the
> + * opened sysfs or device files should prevent the underlying block device
> + * from being removed. So no further delete protection is really needed.
> + *
> + * Protection from multiple readers and writers accessing blktrace data
> + * concurrently is still required. The bd_mutex was used for this purpose.
> + * That could lead to deadlock with concurrent block device deletion and
> + * sysfs access. As a result, a new blk_trace_mutex is now added to be
> + * used solely by the blktrace code.
> + */

Comments about previous locking schemes really don't have a business
in the code - those are remarks for the commit logs.  And in general
please explain the locking scheme near the data that they proctect
it, as locks should always protected data, not code and the comments
should follow that.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7] blktrace: Fix potentail deadlock between delete & sysfs ops Waiman Long <longman@redhat.com> - 2017-09-20 19:30 +0200
  Re: [PATCH v7] blktrace: Fix potentail deadlock between delete &  sysfs ops Christoph Hellwig <hch@infradead.org> - 2017-09-20 19:40 +0200
    Re: [PATCH v7] blktrace: Fix potentail deadlock between delete &  sysfs ops Waiman Long <longman@redhat.com> - 2017-09-20 21:10 +0200
  Re: [PATCH v7] blktrace: Fix potentail deadlock between delete &  sysfs ops Steven Rostedt <rostedt@goodmis.org> - 2017-09-20 19:40 +0200
    Re: [PATCH v7] blktrace: Fix potentail deadlock between delete &  sysfs ops Jens Axboe <axboe@kernel.dk> - 2017-09-20 21:10 +0200
      Re: [PATCH v7] blktrace: Fix potentail deadlock between delete &  sysfs ops Steven Rostedt <rostedt@goodmis.org> - 2017-09-20 21:30 +0200

csiph-web