Re: [PATCH][RESEND] lightnvm: Avoid validation of default op value

2018-02-26 Thread Matias Bjørling
On 02/26/2018 09:22 PM, Heiner Litz wrote: Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl") Signed-off-by: Heiner Litz --- drivers/lightnvm/core.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/core.c

Re: [PATCH] bcache: fix kernel crashes when run fio in a RAID backend bcache device

2018-02-26 Thread Coly Li
Hi linux-raid folks, I also forward this email to linux-raid mailing list, hope you may find something suspicious in raid5 code. Junhui hits a BUG() when bcache runs on top of md raid5, where bio reference count <= 0. There is no other layer on top of bcache, so the most suspicious part is md

Re: [PATCH 2/4] block: bio_check_eod() needs to consider partition

2018-02-26 Thread Jiufei Xue
On 2018/2/27 上午8:11, Christoph Hellwig wrote: > The issue looks real, but please try to do this without another > partition lookup. > Yes, I think the partition size test can be moved to blk_partition_remap(). I will send version 2 later.

Re: [PATCH] bcache: check all uuid elements when start flash only volumes

2018-02-26 Thread Michael Lyle
Reviewed-by: Michael Lyle I have this and the other fix in the queue for testing tomorrow and will pass along a changeset to Jens if all looks good. Thanks! Mike On 02/26/2018 08:15 AM, Coly Li wrote: > On 27/02/2018 12:10 AM, Coly Li wrote: >> Commit 2831231d4c3f ("bcache:

Re: [PATCH] bcache: fix kernel crashes when run fio in a RAID backend bcache device

2018-02-26 Thread Coly Li
On 27/02/2018 9:46 AM, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > Kernel crashed when run fio in a RAID5 backend bcache device, the call > trace is bellow: > [ 440.012034] kernel BUG at block/blk-ioc.c:146! > [ 440.012696] invalid opcode: [#1] SMP NOPTI

Re: [PATCH v2] blk-throttle: fix race between blkcg_bio_issue_check and cgroup_rmdir

2018-02-26 Thread Joseph Qi
Hi Tejun, Could you please help take a look at this and give a confirmation? Thanks, Joseph On 18/2/24 09:45, Joseph Qi wrote: > Hi Tejun, > > On 18/2/23 22:23, Tejun Heo wrote: >> Hello, >> >> On Fri, Feb 23, 2018 at 09:56:54AM +0800, xuejiufei wrote: On Thu, Feb 22, 2018 at 02:14:34PM

[PATCH] bcache: fix kernel crashes when run fio in a RAID backend bcache device

2018-02-26 Thread tang . junhui
From: Tang Junhui Kernel crashed when run fio in a RAID5 backend bcache device, the call trace is bellow: [ 440.012034] kernel BUG at block/blk-ioc.c:146! [ 440.012696] invalid opcode: [#1] SMP NOPTI [ 440.026537] CPU: 2 PID: 2205 Comm: md127_raid5 Not tainted

Re: [PATCH 1/4] block: fix the count of PGPGOUT for WRITE_SAME

2018-02-26 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig

Re: [PATCH 1/6] genhd: Fix leaked module reference for NVME devices

2018-02-26 Thread Christoph Hellwig
On Mon, Feb 26, 2018 at 01:01:37PM +0100, Jan Kara wrote: > Commit 8ddcd653257c "block: introduce GENHD_FL_HIDDEN" added handling of > hidden devices to get_gendisk() but forgot to drop module reference > which is also acquired by get_disk(). Drop the reference as necessary. > > Arguably the

Re: [PATCH 1/4] block: fix the count of PGPGOUT for WRITE_SAME

2018-02-26 Thread Bart Van Assche
On Mon, 2018-02-26 at 20:04 +0800, Jiufei Xue wrote: > The vm counters is counted in sectors, so we should do the conversation > in submit_bio. > > Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and > partitions index") > > Signed-off-by: Jiufei Xue

Re: [PATCH 0/2] blk-mq: kyber: fix domain token leak during requeue

2018-02-26 Thread Omar Sandoval
On Fri, Feb 23, 2018 at 11:36:55PM +0800, Ming Lei wrote: > Hi, > > This two patch fixes domain token leak on kyber scheduler, and actually > fixes one IO hang issue. > > Thanks, > > Ming Lei (2): > blk-mq: don't call io sched's .requeue_request when requeueing rq to > ->dispatch >

Re: [PATCH] nbd: fix return value in error handling path

2018-02-26 Thread Omar Sandoval
On Mon, Feb 12, 2018 at 11:14:55AM -0600, Gustavo A. R. Silva wrote: > It seems that the proper value to return in this particular case is the > one contained into variable new_index instead of ret. > > Addresses-Coverity-ID: 1465148 ("Copy-paste error") > Fixes: e46c7287b1c2 ("nbd: add a basic

Re: [PATCH RFC] sbitmap: Use lock/unlock atomic bitops

2018-02-26 Thread Omar Sandoval
On Sun, Feb 18, 2018 at 05:05:06AM -0800, Tejun Heo wrote: > sbitmap is used to allocate tags. The free and alloc paths use a > memory ordering scheme similar to the one used by waitqueue, where the > waiter and waker synchronize around set_current_state(). > > This doesn't seem sufficient for

Re: [PATCH V15 06/22] mmc: block: Add blk-mq support

2018-02-26 Thread Dmitry Osipenko
On 22.02.2018 20:54, Dmitry Osipenko wrote: > On 22.02.2018 10:42, Adrian Hunter wrote: >> On 21/02/18 22:50, Dmitry Osipenko wrote: >>> On 29.11.2017 16:41, Adrian Hunter wrote: Define and use a blk-mq queue. Discards and flushes are processed synchronously, but reads and writes

Re: [PATCH 3/4] block: display the correct diskname for bio

2018-02-26 Thread Omar Sandoval
On Mon, Feb 26, 2018 at 08:04:41PM +0800, Jiufei Xue wrote: > bio_devname use __bdevname to display the device name, and can > only show the major and minor of the part0. > Fix this by using disk_name to display the correct name. Besides adding a Fixes: tag like Jens said, Reviewed-by: Omar

Re: [PATCH 2/4] block: bio_check_eod() needs to consider partition

2018-02-26 Thread Omar Sandoval
On Mon, Feb 26, 2018 at 08:04:38PM +0800, Jiufei Xue wrote: > bio_check_eod() should get the capacity of partiton, not the whole > disk. > > Signed-off-by: Jiufei Xue > --- > block/blk-core.c | 16 > 1 file changed, 12 insertions(+), 4 deletions(-)

[PATCH][RESEND] lightnvm: Avoid validation of default op value

2018-02-26 Thread Heiner Litz
Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl") Signed-off-by: Heiner Litz --- drivers/lightnvm/core.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index

Re: [PATCH 1/4] block: fix the count of PGPGOUT for WRITE_SAME

2018-02-26 Thread Omar Sandoval
On Mon, Feb 26, 2018 at 08:04:35PM +0800, Jiufei Xue wrote: > The vm counters is counted in sectors, so we should do the conversation > in submit_bio. > > Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and > partitions index") The Fixes line shouldn't be wrapped. Besides

Re: [PATCH][RESEND] lightnvm: Avoid validation of default op value

2018-02-26 Thread Javier Gonzalez
> On 26 Feb 2018, at 21.22, Heiner Litz wrote: > > Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl") > > Signed-off-by: Heiner Litz > --- > drivers/lightnvm/core.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff

Re: [PATCH] lightnvm: Avoid validation of default op value Avoid validation of default op value, if default value is given. In preparation of using the rsvd field of the extended config for additional

2018-02-26 Thread Javier Gonzalez
> On 26 Feb 2018, at 20.45, Heiner Litz wrote: > > Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl") > > Signed-off-by: Heiner Litz > --- > drivers/lightnvm/core.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff

Re: [PATCH] blktrace_api.h: fix comment for struct blk_user_trace_setup

2018-02-26 Thread Jens Axboe
On 1/26/18 5:58 PM, Eric Biggers wrote: > From: Eric Biggers > > 'struct blk_user_trace_setup' is passed to BLKTRACESETUP, not > BLKTRACESTART. Applied, thanks. -- Jens Axboe

Re: [PATCH] blktrace_api.h: fix comment for struct blk_user_trace_setup

2018-02-26 Thread Eric Biggers
On Fri, Jan 26, 2018 at 04:58:06PM -0800, Eric Biggers wrote: > From: Eric Biggers > > 'struct blk_user_trace_setup' is passed to BLKTRACESETUP, not > BLKTRACESTART. > > Signed-off-by: Eric Biggers > --- > include/uapi/linux/blktrace_api.h | 2 +- > 1

Re: [PATCH 17/19] lightnvm: pblk: implement get log report chunk

2018-02-26 Thread Matias Bjørling
On 02/26/2018 02:17 PM, Javier González wrote: From: Javier González In preparation of pblk supporting 2.0, implement the get log report chunk in pblk. This patch only replicates de bad block functionality as the rest of the metadata requires new pblk functionality (e.g.,

Re: [PATCH V3 00/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Matias Bjørling
On 02/26/2018 07:27 PM, Javier Gonzalez wrote: On 26 Feb 2018, at 19.24, Matias Bjørling wrote: On 02/26/2018 07:21 PM, Javier Gonzalez wrote: On 26 Feb 2018, at 19.19, Matias Bjørling wrote: On 02/26/2018 02:16 PM, Javier González wrote: # Changes since

Re: [PATCH V3 00/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Javier Gonzalez
> On 26 Feb 2018, at 19.24, Matias Bjørling wrote: > > On 02/26/2018 07:21 PM, Javier Gonzalez wrote: >>> On 26 Feb 2018, at 19.19, Matias Bjørling wrote: >>> >>> On 02/26/2018 02:16 PM, Javier González wrote: # Changes since V2: Apply Matias'

Re: [PATCH V3 00/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Matias Bjørling
On 02/26/2018 07:21 PM, Javier Gonzalez wrote: On 26 Feb 2018, at 19.19, Matias Bjørling wrote: On 02/26/2018 02:16 PM, Javier González wrote: # Changes since V2: Apply Matias' feedback: - Remove generic nvm_id identify structure. - Do not remap capabilities (cap) to

Re: [PATCH] lightnvm: pblk: remove unused variable

2018-02-26 Thread Javier Gonzalez
> On 26 Feb 2018, at 19.20, Matias Bjørling wrote: > > On 02/26/2018 02:18 PM, Javier González wrote: >> Remove unused variable after a previous cleanup (a8112b631adb) >> Signed-off-by: Javier González >> --- >> drivers/lightnvm/pblk-core.c | 3 --- >> 1

Re: [PATCH V3 00/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Javier Gonzalez
> On 26 Feb 2018, at 19.19, Matias Bjørling wrote: > > On 02/26/2018 02:16 PM, Javier González wrote: >> # Changes since V2: >> Apply Matias' feedback: >> - Remove generic nvm_id identify structure. >> - Do not remap capabilities (cap) to media and controlled capabilities >>

Re: [PATCH] lightnvm: pblk: remove unused variable

2018-02-26 Thread Matias Bjørling
On 02/26/2018 02:18 PM, Javier González wrote: Remove unused variable after a previous cleanup (a8112b631adb) Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c

Re: [PATCH V3 00/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Matias Bjørling
On 02/26/2018 02:16 PM, Javier González wrote: # Changes since V2: Apply Matias' feedback: - Remove generic nvm_id identify structure. - Do not remap capabilities (cap) to media and controlled capabilities (mccap). Instead, add a comment to prevent confusion when crosschecking with

Re: [PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jens Axboe
On Mon, Feb 26 2018, Jan Kara wrote: > On Mon 26-02-18 09:04:40, Jens Axboe wrote: > > On 2/26/18 5:01 AM, Jan Kara wrote: > > > Hello, > > > > > > these patches fix races happening when devices are frequently destroyed > > > and > > > recreated in association of block device inode with

Re: [PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jan Kara
On Mon 26-02-18 09:04:40, Jens Axboe wrote: > On 2/26/18 5:01 AM, Jan Kara wrote: > > Hello, > > > > these patches fix races happening when devices are frequently destroyed and > > recreated in association of block device inode with corresponding gendisk. > > Generally when such race happen it

Re: [PATCH] bcache: check all uuid elements when start flash only volumes

2018-02-26 Thread Coly Li
On 27/02/2018 12:10 AM, Coly Li wrote: > Commit 2831231d4c3f ("bcache: reduce cache_set devices iteration by > devices_max_used") adds c->devices_max_used to reduce iteration of > c->uuids elements, this value is updated in bcache_device_attach(). > > But for flash only volume, when calling

Re: [PATCH][RESEND] block: copy ioprio in __bio_clone_fast()

2018-02-26 Thread Jens Axboe
On 2/26/18 6:29 AM, Hannes Reinecke wrote: > We need to copy the io priority, too; otherwise the clone will run > with a different priority than the original one. What about bio_clone_bioset()? -- Jens Axboe

Re: [PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jens Axboe
On 2/26/18 5:01 AM, Jan Kara wrote: > Hello, > > these patches fix races happening when devices are frequently destroyed and > recreated in association of block device inode with corresponding gendisk. > Generally when such race happen it results in use-after-free issues, block > device page

Re: [PATCH 0/4] fix a few problems in block layer

2018-02-26 Thread Jens Axboe
On 2/26/18 5:01 AM, Jiufei Xue wrote: > I have found a few problems while reviewing the patch 74d46992e0d9 > ("block: replace bi_bdev with a gendisk pointer and partitions index"), > So fix them. Looks good to me. It's important to include a Fixes line in the individual patches, though. Otherwise

Re: Hangs in balance_dirty_pages with arm-32 LPAE + highmem

2018-02-26 Thread Michal Hocko
On Fri 23-02-18 11:51:41, Laura Abbott wrote: > Hi, > > The Fedora arm-32 build VMs have a somewhat long standing problem > of hanging when running mkfs.ext4 with a bunch of processes stuck > in D state. This has been seen as far back as 4.13 but is still > present on 4.14: > [...] > This looks

[PATCH][RESEND] block: copy ioprio in __bio_clone_fast()

2018-02-26 Thread Hannes Reinecke
We need to copy the io priority, too; otherwise the clone will run with a different priority than the original one. Fixes: 43b62ce3ff0a ("block: move bio io prio to a new field") Signed-off-by: Hannes Reinecke --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 05/19] lightnvm: complete geo structure with maxoc*

2018-02-26 Thread Javier González
Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 9 + include/linux/lightnvm.h | 2 ++ 2 files changed, 11 insertions(+) diff --git

[PATCH 02/19] lightnvm: add controller capabilities to 2.0

2018-02-26 Thread Javier González
Assign missing mccap value on 2.0 path Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 4 +++- include/linux/lightnvm.h | 8 +--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c

[PATCH 04/19] lightnvm: add shorten OCSSD version in geo

2018-02-26 Thread Javier González
Create a shorten version to use in the generic geometry. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 6 ++ include/linux/lightnvm.h | 8 2 files changed, 14 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c

[PATCH 03/19] lightnvm: add minor version to generic geometry

2018-02-26 Thread Javier González
Separate the version between major and minor on the generic geometry and represent it through sysfs in the 2.0 path. The 1.2 path only shows the major version to preserve the existing user space interface. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 4

[PATCH 06/19] lightnvm: pblk: check for supported version

2018-02-26 Thread Javier González
At this point, only 1.2 spec is supported, thus check for it. Also, since device-side L2P is only supported in the 1.2 spec, make sure to only check its value under 1.2. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 10 -- 1 file changed, 8

[PATCH 07/19] lightnvm: complete 2.0 values in sysfs

2018-02-26 Thread Javier González
Add missing geometry values to sysfs. Namely, maxoc and maxocpu. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index

[PATCH 18/19] lightnvm: pblk: refactor init/exit sequences

2018-02-26 Thread Javier González
Refactor init and exit sequences to improve readability. In the way, fix bad free ordering on the init error path. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 535 +-- 1 file changed, 267 insertions(+), 268

[PATCH 14/19] nvme: make nvme_get_log_ext available

2018-02-26 Thread Javier González
Make nvme_get_log_ext available outside of core.c. This is in preparation for using it in lightnvm.c Signed-off-by: Javier González --- drivers/nvme/host/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index

[PATCH 19/19] lightnvm: pblk: implement 2.0 support

2018-02-26 Thread Javier González
Implement 2.0 support in pblk. This includes the address formatting and mapping paths, as well as the sysfs entries for them. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 57 ++-- drivers/lightnvm/pblk-sysfs.c | 36 ++--

[PATCH] lightnvm: pblk: remove unused variable

2018-02-26 Thread Javier González
Remove unused variable after a previous cleanup (a8112b631adb) Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index ce6a7cfdba66..e6cb4317bb50

[PATCH 15/19] lightnvm: implement get log report chunk helpers

2018-02-26 Thread Javier González
From: Javier González The 2.0 spec provides a report chunk log page that can be retrieved using the stangard nvme get log page. This replaces the dedicated get/put bad block table in 1.2. This patch implements the helper functions to allow targets retrieve the chunk metadata

[PATCH 16/19] lightnvm: define chunk states

2018-02-26 Thread Javier González
Define chunk states as given in the 2.0 spec. Also, add an extra chunk state that signals that the chunk is in use by the host. This allows for the chunk metadata to be "owned" by a target when active, thus completing the chunk state machine from the host perspective and facilitating sanity

[PATCH 11/19] lightnvm: pblk: rename ppaf* to addrf*

2018-02-26 Thread Javier González
In preparation for 2.0 support in pblk, rename variables referring to the address format to addrf and reserve ppaf for the 1.2 path. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 8 drivers/lightnvm/pblk-sysfs.c | 4 ++--

[PATCH 08/19] lightnvm: rename number of channels and luns

2018-02-26 Thread Javier González
Normalize nomenclature for naming number of channels and number of luns in order to improve readability. Use num_ch and num_lun. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 69 ++-- drivers/lightnvm/pblk-core.c |

[PATCH 12/19] lightnvn: pblk: use generic address format

2018-02-26 Thread Javier González
Use the generic address format on common address manipulations. Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 10 +- drivers/lightnvm/pblk-map.c | 4 ++-- drivers/lightnvm/pblk-sysfs.c | 4 ++-- drivers/lightnvm/pblk.h | 4 ++-- 4

[PATCH 09/19] lightnvm: rename sect_* to sec_*

2018-02-26 Thread Javier González
Rename abbreviations for sector from sect_* to sec_* as most of the code uses this format and it is confusing when using the different structures. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 8 drivers/lightnvm/pblk-sysfs.c | 4 ++--

[PATCH 10/19] lightnvm: add support for 2.0 address format

2018-02-26 Thread Javier González
Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to be able to operate on channel and luns without requiring a format conversion. Use a generic address format for this purpose. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 20

Re: [PATCH] lightnvm: centralize permission check for lightnvm ioctl

2018-02-26 Thread Matias Bjørling
On 02/26/2018 01:11 PM, Johannes Thumshirn wrote: Currently all functions for handling the lightnvm core ioctl commands do a check for CAP_SYS_ADMIN. Change this to fail early in nvm_ctl_ioctl(), so we don't have to duplicate the permission checks all over. Signed-off-by: Johannes Thumshirn

Re: v4.16-rc2: virtio-block + ext4 lockdep splats / sleeping from invalid context

2018-02-26 Thread Jan Kara
On Mon 26-02-18 11:38:19, Mark Rutland wrote: > On Mon, Feb 26, 2018 at 11:52:56AM +0100, Jan Kara wrote: > > On Fri 23-02-18 15:47:36, Mark Rutland wrote: > > > Hi all, > > > > > > While fuzzing arm64/v4.16-rc2 with syzkaller, I simultaneously hit a > > > number of splats in the block layer: > >

[PATCH] lightnvm: centralize permission check for lightnvm ioctl

2018-02-26 Thread Johannes Thumshirn
Currently all functions for handling the lightnvm core ioctl commands do a check for CAP_SYS_ADMIN. Change this to fail early in nvm_ctl_ioctl(), so we don't have to duplicate the permission checks all over. Signed-off-by: Johannes Thumshirn --- drivers/lightnvm/core.c | 21

[PATCH 2/4] block: bio_check_eod() needs to consider partition

2018-02-26 Thread Jiufei Xue
bio_check_eod() should get the capacity of partiton, not the whole disk. Signed-off-by: Jiufei Xue --- block/blk-core.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 6d82c4f..ef6677d

[PATCH 1/4] block: fix the count of PGPGOUT for WRITE_SAME

2018-02-26 Thread Jiufei Xue
The vm counters is counted in sectors, so we should do the conversation in submit_bio. Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index") Signed-off-by: Jiufei Xue --- block/blk-core.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 4/4] block: fix a typo

2018-02-26 Thread Jiufei Xue
Signed-off-by: Jiufei Xue --- drivers/block/pktcdvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 531a091..c61d20c 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@

[PATCH 3/4] block: display the correct diskname for bio

2018-02-26 Thread Jiufei Xue
bio_devname use __bdevname to display the device name, and can only show the major and minor of the part0. Fix this by using disk_name to display the correct name. Signed-off-by: Jiufei Xue --- block/partition-generic.c | 6 ++ include/linux/bio.h | 4

[PATCH 0/4] fix a few problems in block layer

2018-02-26 Thread Jiufei Xue
I have found a few problems while reviewing the patch 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index"), So fix them. Jiufei Xue (4) block: fix the count of PGPGOUT for WRITE_SAME block: bio_check_eod() needs to consider partition block: display the correct disk

[PATCH 4/6] genhd: Fix use after free in __blkdev_get()

2018-02-26 Thread Jan Kara
When two blkdev_open() calls race with device removal and recreation, __blkdev_get() can use looked up gendisk after it is freed: CPU0CPU1CPU2 del_gendisk(disk);

[PATCH 2/6] genhd: Rename get_disk() to get_disk_and_module()

2018-02-26 Thread Jan Kara
Rename get_disk() to get_disk_and_module() to make sure what the function does. It's not a great name but at least it is now clear that put_disk() is not it's counterpart. Signed-off-by: Jan Kara --- block/genhd.c | 10 -- drivers/block/amiflop.c | 2 +-

[PATCH 1/6] genhd: Fix leaked module reference for NVME devices

2018-02-26 Thread Jan Kara
Commit 8ddcd653257c "block: introduce GENHD_FL_HIDDEN" added handling of hidden devices to get_gendisk() but forgot to drop module reference which is also acquired by get_disk(). Drop the reference as necessary. Arguably the function naming here is misleading as put_disk() is *not* the

[PATCH 6/6] blockdev: Avoid two active bdev inodes for one device

2018-02-26 Thread Jan Kara
When blkdev_open() races with device removal and creation it can happen that unhashed bdev inode gets associated with newly created gendisk like: CPU0CPU1 blkdev_open() bdev = bd_acquire() del_gendisk()

[PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

2018-02-26 Thread Jan Kara
Hello, these patches fix races happening when devices are frequently destroyed and recreated in association of block device inode with corresponding gendisk. Generally when such race happen it results in use-after-free issues, block device page cache inconsistencies, or other problems. I have

[PATCH 5/6] genhd: Fix BUG in blkdev_open()

2018-02-26 Thread Jan Kara
When two blkdev_open() calls for a partition race with device removal and recreation, we can hit BUG_ON(!bd_may_claim(bdev, whole, holder)) in blkdev_open(). The race can happen as follows: CPU0CPU1CPU2

[PATCH 3/6] genhd: Add helper put_disk_and_module()

2018-02-26 Thread Jan Kara
Add a proper counterpart to get_disk_and_module() - put_disk_and_module(). Currently it is opencoded in several places. Signed-off-by: Jan Kara --- block/blk-cgroup.c| 11 ++- block/genhd.c | 20 fs/block_dev.c| 19

Re: [PATCH] block: copy ioprio in __bio_clone_fast()

2018-02-26 Thread Hannes Reinecke
On 02/26/2018 11:55 AM, Hannes Reinecke wrote: > We need to copy the io priority, too; otherwise the clone will run > with a different priority than the original one. > > Fixes: 43b62ce3ff0a ("block: move bio io prio to a new field") > Signed-off-by: Hannes Reinecke > --- >

Re: v4.16-rc2: virtio-block + ext4 lockdep splats / sleeping from invalid context

2018-02-26 Thread Mark Rutland
On Mon, Feb 26, 2018 at 11:52:56AM +0100, Jan Kara wrote: > On Fri 23-02-18 15:47:36, Mark Rutland wrote: > > Hi all, > > > > While fuzzing arm64/v4.16-rc2 with syzkaller, I simultaneously hit a > > number of splats in the block layer: > > > > * inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-R}

[PATCH] block: copy ioprio in __bio_clone_fast()

2018-02-26 Thread Hannes Reinecke
We need to copy the io priority, too; otherwise the clone will run with a different priority than the original one. Fixes: 43b62ce3ff0a ("block: move bio io prio to a new field") Signed-off-by: Hannes Reinecke --- block/bio.c | 1 + drivers/vhost/npiv.c | 379

Re: v4.16-rc2: virtio-block + ext4 lockdep splats / sleeping from invalid context

2018-02-26 Thread Jan Kara
On Fri 23-02-18 15:47:36, Mark Rutland wrote: > Hi all, > > While fuzzing arm64/v4.16-rc2 with syzkaller, I simultaneously hit a > number of splats in the block layer: > > * inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-R} usage in > jbd2_trans_will_send_data_barrier > > * BUG: sleeping function