[Nbd] [PATCH 0/7] block: reread partitions improvements
- To: linux-kernel@...25...
- Cc: Jens Axboe <axboe@...161...>, Stefan Weinhuber <wein@...1296...>, nbd-general@lists.sourceforge.net, linux-s390@...25..., Mike Galbraith <bitbucket@...1990...>, Ming Lei <ming.lei@...1301...>, Stefan Haberland <stefan.haberland@...1296...>, Sebastian Ott <sebott@...1294...>, Jarod Wilson <jarod@...696...>, Christoph Hellwig <hch@...1270...>, Peter Zijlstra <peterz@...1270...>, Fabian Frederick <fabf@...1980...>, Alexander Viro <viro@...1300...>, David Herrmann <dh.herrmann@...17...>, Tejun Heo <tj@...1285...>, Andrew Morton <akpm@...133...>
- Subject: [Nbd] [PATCH 0/7] block: reread partitions improvements
- From: Jarod Wilson <jarod@...696...>
- Date: Wed, 8 Apr 2015 02:23:39 -0400
- Message-id: <1428474226-27386-1-git-send-email-jarod@...696...>
- In-reply-to: <1428218688-4092-1-git-send-email-ming.lei@...1301...>
- References: <1428218688-4092-1-git-send-email-ming.lei@...1301...>
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 <hch@...1270...>
CC: Jens Axboe <axboe@...161...>
CC: Tejun Heo <tj@...1285...>
CC: Alexander Viro <viro@...1300...>
CC: Markus Pargmann <mpa@...1897...>
CC: Stefan Weinhuber <wein@...1296...>
CC: Stefan Haberland <stefan.haberland@...1296...>
CC: Sebastian Ott <sebott@...1294...>
CC: Fabian Frederick <fabf@...1980...>
CC: Ming Lei <ming.lei@...1301...>
CC: David Herrmann <dh.herrmann@...17...>
CC: Mike Galbraith <bitbucket@...1990...>
CC: Andrew Morton <akpm@...133...>
CC: Peter Zijlstra <peterz@...1270...>
CC: nbd-general@lists.sourceforge.net
CC: linux-s390@...25...
--
1.8.3.1
Reply to: