Re: Change device block count from userspace?

2018-04-17 Thread Manuel Lauss
On Wed, Apr 18, 2018 at 12:43 AM, Martin K. Petersen wrote: > > Manuel, > >> I have a SATA SSD which suddenly reports its size as 2.2TB, 0x >> block count: > > "Suddenly" as in out of the blue? Or after a drive firmware update? Or a > kernel ditto? Out of the blue, yes. I think it's actu

[PATCH 0/4 V2] iomap: Use FUA for O_DSYNC DIO writes

2018-04-17 Thread Dave Chinner
Hi folks, This is the latest version of the "use FUA for DIO writes" patchset that was last posted here: https://marc.info/?l=linux-xfs&m=152213446528167&w=2 Functionality and performance is the same as the previous version. Changes in this version address Christoph's review comments. Version 2

[PATCH 2/4] iomap: iomap_dio_rw() handles all sync writes

2018-04-17 Thread Dave Chinner
From: Dave Chinner Currently iomap_dio_rw() only handles (data)sync write completions for AIO. This means we can't optimised non-AIO IO to minimise device flushes as we can't tell the caller whether a flush is required or not. To solve this problem and enable further optimisations, make iomap_di

[PATCH 3/4] blk: add blk_queue_fua() helper function

2018-04-17 Thread Dave Chinner
From: Dave Chinner So we can check FUA support status from the iomap direct IO code. Signed-Off-By: Dave Chinner --- include/linux/blkdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9af3e0f430bc..c362aadfe036 100644 --- a/include/

[PATCH 1/4] xfs: move generic_write_sync calls inwards

2018-04-17 Thread Dave Chinner
From: Dave Chinner To prepare for iomap iinfrastructure based DSYNC optimisations. While moving the code araound, move the XFS write bytes metric update for direct IO into xfs_dio_write_end_io callback so that we always capture the amount of data written via AIO+DIO. This fixes the problem where

[PATCH 4/4] iomap: Use FUA for pure data O_DSYNC DIO writes

2018-04-17 Thread Dave Chinner
From: Dave Chinner If we are doing direct IO writes with datasync semantics, we often have to flush metadata changes along with the data write. However, if we are overwriting existing data, there are no metadata changes that we need to flush. In this case, optimising the IO by using FUA write mak

Re: [PATCH 03/11] fs: add frozen sb state helpers

2018-04-17 Thread Luis R. Rodriguez
On Thu, Dec 21, 2017 at 12:03:29PM +0100, Jan Kara wrote: > Hello, > > I think I owe you a reply here... Sorry that it took so long. Took me just as long :) > On Fri 01-12-17 22:13:27, Luis R. Rodriguez wrote: > > > > I'll note that its still not perfectly clear if really the semantics behind >

Re: [PATCH v2 00/10] SWIM driver fixes

2018-04-17 Thread Finn Thain
Hi Geert, On Tue, 17 Apr 2018, I wrote: > On Wed, 11 Apr 2018, I wrote: > > > This patch series has fixes for bugs in the SWIM floppy disk > > controller driver, including an oops and a soft lockup. > > > > Apparently no-one is authorized to push this series intact. > > Geert, would you plea

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 5:06 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 3:57 PM, Jens Axboe wrote: >> On 4/17/18 3:48 PM, Jens Axboe wrote: >>> On 4/17/18 3:47 PM, Kees Cook wrote: On Tue, Apr 17, 2018 at 2:39 PM, Jens Axboe wrote: > On 4/17/18 3:25 PM, Kees Cook wrote: >> On Tue, Apr 17, 201

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 3:57 PM, Jens Axboe wrote: > On 4/17/18 3:48 PM, Jens Axboe wrote: >> On 4/17/18 3:47 PM, Kees Cook wrote: >>> On Tue, Apr 17, 2018 at 2:39 PM, Jens Axboe wrote: On 4/17/18 3:25 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: >> I see

Re: [PATCH] blk-mq: Clear out elevator private data

2018-04-17 Thread Jens Axboe
On 4/17/18 4:57 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 2:45 PM, Jens Axboe wrote: >> On 4/17/18 3:42 PM, Kees Cook wrote: >>> Some elevators may not correctly check rq->rq_flags & RQF_ELVPRIV, and >>> may attempt to read rq->elv fields. When requests got reused, this >>> caused BFQ to thin

Re: [PATCH] block: Avoid executing a report or reset zones while a queue is frozen

2018-04-17 Thread Damien Le Moal
Christoph, On 2018/04/17 8:18, Christoph Hellwig wrote: > On Mon, Apr 16, 2018 at 06:00:34PM -0700, Bart Van Assche wrote: >> This patch on itself does not change the behavior of either ioctl. >> However, this patch is necessary to avoid that these ioctls fail >> with -EIO if sd_revalidate_disk()

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 3:48 PM, Jens Axboe wrote: > On 4/17/18 3:47 PM, Kees Cook wrote: >> On Tue, Apr 17, 2018 at 2:39 PM, Jens Axboe wrote: >>> On 4/17/18 3:25 PM, Kees Cook wrote: On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: > I see elv.priv[1] assignments made in a few places -- is it poss

Re: [PATCH] blk-mq: Clear out elevator private data

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 2:45 PM, Jens Axboe wrote: > On 4/17/18 3:42 PM, Kees Cook wrote: >> Some elevators may not correctly check rq->rq_flags & RQF_ELVPRIV, and >> may attempt to read rq->elv fields. When requests got reused, this >> caused BFQ to think it already had a bfqq (rq->elv.priv[1]) a

Re: Change device block count from userspace?

2018-04-17 Thread Martin K. Petersen
Manuel, > I have a SATA SSD which suddenly reports its size as 2.2TB, 0x > block count: "Suddenly" as in out of the blue? Or after a drive firmware update? Or a kernel ditto? -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] nvme: lightnvm: add granby support

2018-04-17 Thread Keith Busch
On Tue, Apr 17, 2018 at 04:15:38PM -0600, Jens Axboe wrote: > >> Looks good to me. > >> > >> Reviewed-by: Matias Bjørling > >> > >> Keith, when convenient can you pick this up for 4.18? > > > > This looks safe for 4.17-rc2, no? Unless you want to wait for the next > > release. > > It should wait

Re: [PATCH] nvme: lightnvm: add granby support

2018-04-17 Thread Jens Axboe
On 4/17/18 4:09 PM, Keith Busch wrote: > On Tue, Apr 17, 2018 at 08:16:25AM +0200, Matias Bjørling wrote: >> On 4/17/18 3:55 AM, Wei Xu wrote: >>> Add a new lightnvm quirk to identify CNEX’s Granby controller. >>> >>> Signed-off-by: Wei Xu >>> --- >>> drivers/nvme/host/pci.c | 2 ++ >>> 1 file

Re: [PATCH] nvme: lightnvm: add granby support

2018-04-17 Thread Keith Busch
On Tue, Apr 17, 2018 at 08:16:25AM +0200, Matias Bjørling wrote: > On 4/17/18 3:55 AM, Wei Xu wrote: > > Add a new lightnvm quirk to identify CNEX’s Granby controller. > > > > Signed-off-by: Wei Xu > > --- > > drivers/nvme/host/pci.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Oleksandr Natalenko
Hi. 17.04.2018 23:47, Kees Cook wrote: I sent the patch anyway, since it's kind of a robustness improvement, I'd hope. If you fix BFQ also, please add: Reported-by: Oleksandr Natalenko Root-caused-by: Kees Cook :) I gotta task-switch to other things! Thanks for the pointers, and thank you O

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 3:47 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 2:39 PM, Jens Axboe wrote: >> On 4/17/18 3:25 PM, Kees Cook wrote: >>> On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: I see elv.priv[1] assignments made in a few places -- is it possible there is some kind of uninitialize

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 2:39 PM, Jens Axboe wrote: > On 4/17/18 3:25 PM, Kees Cook wrote: >> On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: >>> I see elv.priv[1] assignments made in a few places -- is it possible >>> there is some kind of uninitialized-but-not-NULL state that can leak >>> in t

Re: [PATCH] blk-mq: Clear out elevator private data

2018-04-17 Thread Jens Axboe
On 4/17/18 3:42 PM, Kees Cook wrote: > Some elevators may not correctly check rq->rq_flags & RQF_ELVPRIV, and > may attempt to read rq->elv fields. When requests got reused, this > caused BFQ to think it already had a bfqq (rq->elv.priv[1]) allocated. > This could lead to odd behaviors like having

[PATCH] blk-mq: Clear out elevator private data

2018-04-17 Thread Kees Cook
Some elevators may not correctly check rq->rq_flags & RQF_ELVPRIV, and may attempt to read rq->elv fields. When requests got reused, this caused BFQ to think it already had a bfqq (rq->elv.priv[1]) allocated. This could lead to odd behaviors like having the sense buffer address slowly start increme

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 3:25 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: >> I see elv.priv[1] assignments made in a few places -- is it possible >> there is some kind of uninitialized-but-not-NULL state that can leak >> in there? > > Got it. This fixes it for me: > > diff --git a

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 1:46 PM, Kees Cook wrote: > I see elv.priv[1] assignments made in a few places -- is it possible > there is some kind of uninitialized-but-not-NULL state that can leak > in there? Got it. This fixes it for me: diff --git a/block/blk-mq.c b/block/blk-mq.c index 0dc9e341c2a

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 1:28 PM, Jens Axboe wrote: > It has to be the latter bfqq->dispatched increment, as those are > transient (and bfqd is not). Yeah, and I see a lot of comments around the lifetime of rq and bfqq, so I assume something is not being locked correctly. #define RQ_BFQQ(rq)

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 2:25 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 1:20 PM, Kees Cook wrote: >> On Tue, Apr 17, 2018 at 1:03 PM, Kees Cook wrote: >>> The above bfq_dispatch_request+0x99/0xad0 is still >>> __bfq_dispatch_request at block/bfq-iosched.c:3902, just with KASAN >>> removed. 0x99 is 153 dec

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 1:20 PM, Kees Cook wrote: > On Tue, Apr 17, 2018 at 1:03 PM, Kees Cook wrote: >> The above bfq_dispatch_request+0x99/0xad0 is still >> __bfq_dispatch_request at block/bfq-iosched.c:3902, just with KASAN >> removed. 0x99 is 153 decimal: >> >> (gdb) disass bfq_dispatch_reque

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 1:03 PM, Kees Cook wrote: > The above bfq_dispatch_request+0x99/0xad0 is still > __bfq_dispatch_request at block/bfq-iosched.c:3902, just with KASAN > removed. 0x99 is 153 decimal: > > (gdb) disass bfq_dispatch_request > Dump of assembler code for function bfq_dispatch_requ

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Mon, Apr 16, 2018 at 8:12 PM, Kees Cook wrote: > With a hardware watchpoint, I've isolated the corruption to here: > > bfq_dispatch_request+0x2be/0x1610: > __bfq_dispatch_request at block/bfq-iosched.c:3902 > 3900if (rq) { > 3901inc_in_driver_start_rq: > 3902

Re: [PATCH 01/12] iommu-common: move to arch/sparc

2018-04-17 Thread Christoph Hellwig
On Mon, Apr 16, 2018 at 09:58:33AM -0400, David Miller wrote: > From: Anshuman Khandual > Date: Mon, 16 Apr 2018 14:26:07 +0530 > > > On 04/15/2018 08:29 PM, Christoph Hellwig wrote: > >> This code is only used by sparc, and all new iommu drivers should use the > >> drivers/iommu/ framework. Als

[PATCH v3 18/20] spi: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 17/20] serial: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 19/20] staging: vc04_services: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 13/20] mmc: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 05/20] firewire: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 12/20] media: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 07/20] i2c: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 14/20] mtd: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 06/20] fpga: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 16/20] remoteproc: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 00/20] Allow compile-testing NO_DMA (drivers)

2018-04-17 Thread Geert Uytterhoeven
Hi all, As of v4.17-rc1, patch series "[PATCH v2 0/5] Allow compile-testing NO_DMA (core)" (https://lkml.org/lkml/2018/3/16/435) has been included upstream, and drivers using the DMA API can be compile-tested on platforms selecting NO_DMA. This follow-up patch series removes dependencies

[PATCH v3 02/20] ata: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 11/20] mailbox: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 10/20] lightnvm: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 09/20] iommu: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 04/20] fbdev: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 03/20] crypto: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 20/20] usb: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 01/20] ASoC: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 08/20] iio: adc: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

[PATCH v3 15/20] net: Remove depends on HAS_DMA in case of platform dependency

2018-04-17 Thread Geert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their

Re: [PATCH] block: Avoid executing a report or reset zones while a queue is frozen

2018-04-17 Thread Bart Van Assche
On Tue, 2018-04-17 at 17:18 +0200, Christoph Hellwig wrote: > On Mon, Apr 16, 2018 at 06:00:34PM -0700, Bart Van Assche wrote: > > This patch on itself does not change the behavior of either ioctl. > > However, this patch is necessary to avoid that these ioctls fail > > with -EIO if sd_revalidate_d

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Jens Axboe
On 4/17/18 10:42 AM, Kees Cook wrote: > On Mon, Apr 16, 2018 at 8:12 PM, Kees Cook wrote: >> With a hardware watchpoint, I've isolated the corruption to here: >> >> bfq_dispatch_request+0x2be/0x1610: >> __bfq_dispatch_request at block/bfq-iosched.c:3902 >> 3900if (rq) { >> 3901inc_

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Mon, Apr 16, 2018 at 8:12 PM, Kees Cook wrote: > With a hardware watchpoint, I've isolated the corruption to here: > > bfq_dispatch_request+0x2be/0x1610: > __bfq_dispatch_request at block/bfq-iosched.c:3902 > 3900if (rq) { > 3901inc_in_driver_start_rq: > 3902

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 3:02 AM, James Bottomley wrote: > On Mon, 2018-04-16 at 20:12 -0700, Kees Cook wrote: >> I still haven't figured this out, though... any have a moment to look >> at this? > > Just to let you know you're not alone ... but I can't make any sense of > this either. The bfdq is

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Kees Cook
On Tue, Apr 17, 2018 at 2:19 AM, Oleksandr Natalenko wrote: > By any chance, have you tried to simplify the reproducer environment, or it > still needs my complex layout to trigger things even with KASAN? I haven't tried minimizing the reproducer yet, no. Now that I have a specific place to watch

[PATCH v2] target: Fix Fortify_panic kernel exception

2018-04-17 Thread Bryant G. Ly
The bug exists in the memcmp in which the length passed in must be guaranteed to be 1. This bug currently exists because the second pointer passed in, can be smaller than the cmd->data_length, which causes a fortify_panic. The fix is to use memchr_inv instead to find whether or not a 0 exists inst

Re: [PATCH] block: Avoid executing a report or reset zones while a queue is frozen

2018-04-17 Thread Bart Van Assche
On Tue, 2018-04-17 at 17:18 +0200, Christoph Hellwig wrote: > On Mon, Apr 16, 2018 at 06:00:34PM -0700, Bart Van Assche wrote: > > This patch on itself does not change the behavior of either ioctl. > > However, this patch is necessary to avoid that these ioctls fail > > with -EIO if sd_revalidate_d

[PATCH v4] blktests: regression test "block: do not use interruptible wait anywhere"

2018-04-17 Thread Alan Jenkins
> Without this fix, I get an IO error in this test: > > # dd if=/dev/sda of=/dev/null iflag=direct & \ > while killall -SIGUSR1 dd; do sleep 0.1; done & \ > echo mem > /sys/power/state ; \ > sleep 5; killall dd # stop after 5 seconds linux-block specifically asked for a test derived from th

Re: [PATCH] target: Fix Fortify_panic kernel exception

2018-04-17 Thread Christoph Hellwig
On Tue, Apr 17, 2018 at 10:18:17AM -0500, Bryant G. Ly wrote: > > On 4/13/18 11:44 AM, Christoph Hellwig wrote: > > > The patch looks fine, but in general I think descriptions of what > > you fixed in the code or more important than starting out with > > a backtrace. > > > > E.g. please explain w

Re: [PATCH] block: Avoid executing a report or reset zones while a queue is frozen

2018-04-17 Thread Christoph Hellwig
On Mon, Apr 16, 2018 at 06:00:34PM -0700, Bart Van Assche wrote: > This patch on itself does not change the behavior of either ioctl. > However, this patch is necessary to avoid that these ioctls fail > with -EIO if sd_revalidate_disk() is called while these ioctls are > in progress because the cur

Re: [PATCH] target: Fix Fortify_panic kernel exception

2018-04-17 Thread Bryant G. Ly
On 4/13/18 11:44 AM, Christoph Hellwig wrote: > The patch looks fine, but in general I think descriptions of what > you fixed in the code or more important than starting out with > a backtrace. > > E.g. please explain what was wrong, how you fixed it and only after > that mention how it was caugh

Re: [PATCH] target: fix crash with iscsi target and dvd

2018-04-17 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig Btw, seems like someone needs to volunteer for putting together a pull request with target fixes for Linus - I haven't heard from Nic for a while, and we've got quite a few fixes out on the list.

[PATCH v3] blktests: regression test "block: do not use interruptible wait anywhere"

2018-04-17 Thread Alan Jenkins
> Without this fix, I get an IO error in this test: > > # dd if=/dev/sda of=/dev/null iflag=direct & \ > while killall -SIGUSR1 dd; do sleep 0.1; done & \ > echo mem > /sys/power/state ; \ > sleep 5; killall dd # stop after 5 seconds linux-block specifically asked for a test derived from th

Re: [PATCH] blktests: regression test "block: do not use interruptible wait anywhere"

2018-04-17 Thread Alan Jenkins
On 17/04/18 08:21, Johannes Thumshirn wrote: On Mon, Apr 16, 2018 at 10:52:47PM +0100, Alan Jenkins wrote: Without this fix, I get an IO error in this test: # dd if=/dev/sda of=/dev/null iflag=direct & \ while killall -SIGUSR1 dd; do sleep 0.1; done & \ echo mem > /sys/power/state ; \

Re: [PATCH] blk-mq: start request gstate with gen 1

2018-04-17 Thread jianchao.wang
Hi Martin On 04/17/2018 08:10 PM, Martin Steigerwald wrote: > For testing it I add it to 4.16.2 with the patches I have already? You could try to only apply this patch to have a test. :) > > - '[PATCH] blk-mq_Directly schedule q->timeout_work when aborting a > request.mbox' > > - '[PATCH v2]

Re: [PATCH 01/12] iommu-common: move to arch/sparc

2018-04-17 Thread Michael Ellerman
Anshuman Khandual writes: > On 04/16/2018 07:28 PM, David Miller wrote: >> From: Anshuman Khandual >> Date: Mon, 16 Apr 2018 14:26:07 +0530 >> >>> On 04/15/2018 08:29 PM, Christoph Hellwig wrote: This code is only used by sparc, and all new iommu drivers should use the drivers/iommu/ f

Re: [PATCH] blkcg: not hold blkcg lock when deactivating policy.

2018-04-17 Thread Paolo Valente
> Il giorno 17 apr 2018, alle ore 09:10, Jiang Biao ha > scritto: > > As described in the comment of blkcg_activate_policy(), > *Update of each blkg is protected by both queue and blkcg locks so > that holding either lock and testing blkcg_policy_enabled() is > always enough for dereferencing

Re: [PATCH 08/11] lightnvm: pblk: remove unnecessary argument

2018-04-17 Thread Matias Bjørling
On 4/16/18 12:25 PM, Javier González wrote: Remove unnecessary argument on pblk_line_free() Why was the argument no longer needed? Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 6 +++--- drivers/lightnvm/pblk-init.c | 2 +- drivers/lightnvm/pblk.h | 2 +- 3 fil

Re: [RESEND PATCH v1 1/2] trace: events: scsi: Add tag in SCSI trace events

2018-04-17 Thread Bean Huo (beanhuo)
>On Mon, 2018-04-16 at 20:27 +, Bean Huo (beanhuo) wrote: >> By the way, these patches are not to add new feature, they are just to >> add print tag along with the other exist printed request parameters. > >Are you aware that there are two tag fields in struct request, namely "tag" >and "intern

Re: [PATCH 07/11] lightnvm: pblk: remove unnecessary indirection

2018-04-17 Thread Matias Bjørling
On 4/16/18 12:25 PM, Javier González wrote: Remove unnecessary indirection on the read path. Title and description are the same. Can you elaborate what changed since pblk_submit_io now directly can be returned, and doesn't have its return value rewritten to NVM_IO_ERR? Signed-off-by: Javi

Re: [PATCH] blk-mq: start request gstate with gen 1

2018-04-17 Thread Martin Steigerwald
Hi Jianchao, Jianchao Wang - 17.04.18, 05:46: > rq->gstate and rq->aborted_gstate both are zero before rqs are > allocated. If we have a small timeout, when the timer fires, > there could be rqs that are never allocated, and also there could > be rq that has been allocated but not initialized and

Re: [PATCH 03/11] lightnvm: pblk: check read lba on gc path

2018-04-17 Thread Matias Bjørling
On 4/16/18 12:25 PM, Javier González wrote: Check that the lba stored in the LBA metadata is correct in the GC path too. This requires a new helper function to check random reads in the vector read. Signed-off-by: Javier González --- drivers/lightnvm/pblk-read.c | 39 +

Re: [PATCH] lightnvm: pblk: take bitmap alloc. out of critical section

2018-04-17 Thread Matias Bjørling
On 4/16/18 12:21 PM, Javier González wrote: Allocate line bitmaps outside of the line lock on line preparation. Signed-off-by: Javier González The patch description tells what the patch does, it should tell why the change the done. --- drivers/lightnvm/pblk-core.c | 96

Re: [RESEND PATCH v1 1/2] trace: events: scsi: Add tag in SCSI trace events

2018-04-17 Thread Bean Huo (beanhuo)
Hi, Steve Right, Please see below portion log from ftrace and blktrace, There is no any impact on blktrace. > >Looking at the code from >git://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git > >It appears that it does not rely on the ftrace ring buffers. > >So I'm guessing blktrace is

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread James Bottomley
On Mon, 2018-04-16 at 20:12 -0700, Kees Cook wrote: > I still haven't figured this out, though... any have a moment to look > at this? Just to let you know you're not alone ... but I can't make any sense of this either. The bfdq is the elevator_data, which is initialised when the scheduler is att

Re: [PATCH blktests] scsi/004: add regression test for false BLK_STS_OK with non good SAM status

2018-04-17 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCH] nvme: lightnvm: add granby support

2018-04-17 Thread Javier Gonzalez
> On 17 Apr 2018, at 03.55, Wei Xu wrote: > > Add a new lightnvm quirk to identify CNEX’s Granby controller. > > Signed-off-by: Wei Xu > --- > drivers/nvme/host/pci.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > index cb73bc8..94

Re: usercopy whitelist woe in scsi_sense_cache

2018-04-17 Thread Oleksandr Natalenko
Hi. 17.04.2018 05:12, Kees Cook wrote: Turning off HARDENED_USERCOPY and turning on KASAN, I see the same report: [ 38.274106] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x42/0x60 [ 38.274841] Read of size 22 at addr 8800122b8c4b by task smartctl/1064 [ 38.275630] [ 38.2758

Re: [PATCH] nbd: do not update block size if file system is mounted

2018-04-17 Thread Michael Tretter
Hi Josef, On Sat, 14 Apr 2018 01:10:27 +, Josef Bacik wrote: > Yeah sorry I screwed that up again. I’m wondering if we can just > drop this altogether and leave the zero setting in the config put > that we already have. I'm not sure if I understand you correctly. The nbd_config_put() functio

[PATCH blktests] scsi/004: add regression test for false BLK_STS_OK with non good SAM status

2018-04-17 Thread Steffen Maier
Signed-off-by: Steffen Maier --- tests/scsi/004 | 59 tests/scsi/004.out |3 ++ 2 files changed, 62 insertions(+), 0 deletions(-) create mode 100755 tests/scsi/004 create mode 100644 tests/scsi/004.out diff --git a/tests/scsi/004 b

Re: [PATCH] blktests: regression test "block: do not use interruptible wait anywhere"

2018-04-17 Thread Johannes Thumshirn
On Mon, Apr 16, 2018 at 10:52:47PM +0100, Alan Jenkins wrote: > > Without this fix, I get an IO error in this test: > > > > # dd if=/dev/sda of=/dev/null iflag=direct & \ > > while killall -SIGUSR1 dd; do sleep 0.1; done & \ > > echo mem > /sys/power/state ; \ > > sleep 5; killall dd # stop

[PATCH] blkcg: not hold blkcg lock when deactivating policy.

2018-04-17 Thread Jiang Biao
As described in the comment of blkcg_activate_policy(), *Update of each blkg is protected by both queue and blkcg locks so that holding either lock and testing blkcg_policy_enabled() is always enough for dereferencing policy data.* with queue lock held, there is no need to hold blkcg lock in blkcg_