Skip to content

block: reread partitions improvements

Jarod Wilson linux-s390 lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7block: export blkdev_reread_part() and __blkdev_reread_part()block/ioctl.c include/linux/fs.h+26 -34 replies
2/7block: loop: don't hold lo_ctl_mutex in lo_opendrivers/block/loop.c drivers/block/loop.h+27 -65 replies
3/7block: loop: fix another reread part failuredrivers/block/loop.c+24 -40 replies
4/7block: nbd: convert to blkdev_reread_part()drivers/block/nbd.c+1 -10 replies
5/7block: dasd_genhd: convert to blkdev_reread_partdrivers/s390/block/dasd_genhd.c+4 -70 replies
6/7block: replace trylock with mutex_lock in blkdev_reread_part()block/ioctl.c+8 -40 replies
7/7s390/block/dasd: remove obsolete while -EBUSY loopdrivers/s390/block/dasd_genhd.c+3 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] block: reread partitions improvements

For loop, the root cause is one ABBA and one AA lock dependency issue, and the two are fixed by patch 2 and patch 3 each.

Another reason is from the trylock in blkdev_reread_part(), which may cause partition scanning failure too sometimes when another task is holding the bd_mutex. In the discussion[1], both Tejun and Christoph suggests to replace the trylock with mutex_lock in blkdev_reread_part(), also Christoph suggests to export blkdev_reread_part.

Following the discussion, this patchset exports blkdev_reread_part(), and introduces lockless __blkdev_reread_part() for fixing loop's AA lock issue. Then ioctl_by_bdev(BLKRRPART) in loop, nbd and dasd is replaced with blkdev_reread_part(). In the last patch, trylock in blkdev_reread_part() is replaced with mutex_lock, and some analysis is provided about the conversion.

This is a slightly reworked set from what Ming sent a few days ago, based on Christoph's feedback. I've tested this out quite succesfully in the scenario that prompted my first patch as well.

[1], https://lkml.org/lkml/2015/1/26/137
[2], https://lkml.org/lkml/2015/3/31/888

Jarod Wilson (3):
block: export blkdev_reread_part() and __blkdev_reread_part()
block: loop: fix another reread part failure s390/block/dasd: remove obsolete while -EBUSY loop

Ming Lei (4):
block: loop: don't hold lo_ctl_mutex in lo_open
block: nbd: convert to blkdev_reread_part()
block: dasd_genhd: convert to blkdev_reread_part
block: replace trylock with mutex_lock in blkdev_reread_part()

 block/ioctl.c                   | 34 +++++++++++++++++++----
 drivers/block/loop.c            | 60 ++++++++++++++++++++++++++++++++++-------
 drivers/block/loop.h            |  1 +
 drivers/block/nbd.c             |  2 +-
 drivers/s390/block/dasd_genhd.c | 22 +++++----------
 include/linux/fs.h              |  3 +++
 6 files changed, 90 insertions(+), 32 deletions(-)
CC Christoph Hellwig <[email protected]>
CC Jens Axboe <[email protected]>
CC Tejun Heo <[email protected]>
CC Alexander Viro <[email protected]>
CC Markus Pargmann <[email protected]>
CC Stefan Weinhuber <[email protected]>
CC Stefan Haberland <[email protected]>
CC Sebastian Ott <[email protected]>
CC Fabian Frederick <[email protected]>
CC Ming Lei <[email protected]>
CC David Herrmann <[email protected]>
CC Mike Galbraith <[email protected]>
CC Andrew Morton <[email protected]>
CC Peter Zijlstra <[email protected]>
Signature · 1 line
1.8.3.1