linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] block: fix blktrace debugfs use after free
@ 2020-04-29  7:46 Luis Chamberlain
  2020-04-29  7:46 ` [PATCH v3 1/6] block: revert back to synchronous request_queue removal Luis Chamberlain
                   ` (5 more replies)
  0 siblings, 6 replies; 34+ messages in thread
From: Luis Chamberlain @ 2020-04-29  7:46 UTC (permalink / raw)
  To: axboe, viro, bvanassche, gregkh, rostedt, mingo, jack, ming.lei,
	nstange, akpm
  Cc: mhocko, yukuai3, linux-block, linux-fsdevel, linux-mm,
	linux-kernel, Luis Chamberlain

Alrighty, here is v3 with all the BUG_*() crap removed, and moving
to just create the debugfs directory needed for the partitions as well
at initialization. This allows us to get rid of the pesky
debugfs_lookup() calls which has made this code very awkward, and
allowed us to find surprising bugs when we went with an
asynchronous request_queue removal.

I'll note that I still see this:

debugfs: Directory 'loop0' with parent 'block' already present!

But only for break-blktrace [0] run_0004.sh. But since we don't
have any more races with blktrace, this has pushed me to look
into disk registration / deletion. I'll be posting patches soon
about some changes to help with that, on the error handling.

If, after these patches, you however find the root cause to this
let me know!

Also, if folks don't disagree, I'll likely follow up to just merge
break-blktrace as a self-test for blktrace. We can later expand on it
upstream instead.

These patches are based on linux-next tag next-20200428, you can find
the code on my 20200428-blktrace-fixes branch [1].

[0] https://github.com/mcgrof/break-blktrace
[1] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20200428-blktrace-fixes

Luis Chamberlain (6):
  block: revert back to synchronous request_queue removal
  block: move main block debugfs initialization to its own file
  blktrace: move blktrace debugfs creation to helper function
  blktrace: fix debugfs use after free
  blktrace: break out of blktrace setup on concurrent calls
  loop: be paranoid on exit and prevent new additions / removals

 block/Makefile               |  1 +
 block/blk-core.c             | 32 ++++++++++++----
 block/blk-debugfs.c          | 44 ++++++++++++++++++++++
 block/blk-mq-debugfs.c       |  5 ---
 block/blk-sysfs.c            | 47 ++++++++++++-----------
 block/blk.h                  | 18 +++++++++
 block/genhd.c                | 73 +++++++++++++++++++++++++++++++++++-
 block/partitions/core.c      |  3 ++
 drivers/block/loop.c         |  4 ++
 drivers/scsi/sg.c            |  2 +
 include/linux/blkdev.h       |  7 ++--
 include/linux/blktrace_api.h |  1 -
 include/linux/genhd.h        | 18 +++++++++
 kernel/trace/blktrace.c      | 39 ++++++++++++++++---
 14 files changed, 249 insertions(+), 45 deletions(-)
 create mode 100644 block/blk-debugfs.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2020-05-07 11:31 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  7:46 [PATCH v3 0/6] block: fix blktrace debugfs use after free Luis Chamberlain
2020-04-29  7:46 ` [PATCH v3 1/6] block: revert back to synchronous request_queue removal Luis Chamberlain
2020-04-29 11:15   ` Christoph Hellwig
2020-05-02  0:22   ` Bart Van Assche
2020-05-03 10:32     ` Matthew Wilcox
2020-05-04 16:18       ` Luis Chamberlain
2020-05-04 16:16     ` Luis Chamberlain
2020-04-29  7:46 ` [PATCH v3 2/6] block: move main block debugfs initialization to its own file Luis Chamberlain
2020-04-29 11:15   ` Christoph Hellwig
2020-04-29  7:46 ` [PATCH v3 3/6] blktrace: move blktrace debugfs creation to helper function Luis Chamberlain
2020-04-29 11:20   ` Christoph Hellwig
2020-05-02  0:25   ` Bart Van Assche
2020-04-29  7:46 ` [PATCH v3 4/6] blktrace: fix debugfs use after free Luis Chamberlain
2020-04-29  9:47   ` Greg KH
2020-04-29 11:26   ` Christoph Hellwig
2020-04-29 11:45     ` Luis Chamberlain
2020-04-29 11:50       ` Christoph Hellwig
2020-04-29 12:02         ` Luis Chamberlain
2020-04-29 12:04           ` Christoph Hellwig
2020-04-29 12:21             ` Luis Chamberlain
2020-04-29 12:57               ` Greg KH
2020-05-01 15:24                 ` Luis Chamberlain
2020-05-07 11:30   ` [blktrace] d106a3fdba: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2020-04-29  7:46 ` [PATCH v3 5/6] blktrace: break out of blktrace setup on concurrent calls Luis Chamberlain
2020-04-29  9:49   ` Greg KH
2020-05-01 15:06     ` Luis Chamberlain
2020-05-01 15:34       ` Christoph Hellwig
2020-05-01 15:40         ` Luis Chamberlain
2020-05-01 15:50           ` Luis Chamberlain
2020-05-01 16:51       ` Greg KH
2020-04-29  7:46 ` [PATCH v3 6/6] loop: be paranoid on exit and prevent new additions / removals Luis Chamberlain
2020-04-29  9:50   ` Greg KH
2020-05-03  9:09     ` Luis Chamberlain
2020-04-29 14:05   ` Ming Lei

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).