Re: [PATCH v4 01/11] blk-mq: fix direct issue

2017-06-05 Thread Ming Lei
On Mon, Jun 05, 2017 at 09:25:29PM +, Bart Van Assche wrote: > On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > > +static void __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, > > + struct request *rq, > > +

Re: [PATCH v5 08/17] dax: set errors in mapping when writeback fails

2017-06-05 Thread Jeff Layton
On Mon, 2017-06-05 at 19:01 -0600, Ross Zwisler wrote: > On Wed, May 31, 2017 at 08:45:31AM -0400, Jeff Layton wrote: > > Jan's description for this patch is much better than mine, so I'm > > quoting it verbatim here: > > > > -8<- > > DAX currently doesn't set

Re: [PATCH v5 08/17] dax: set errors in mapping when writeback fails

2017-06-05 Thread Ross Zwisler
On Wed, May 31, 2017 at 08:45:31AM -0400, Jeff Layton wrote: > Jan's description for this patch is much better than mine, so I'm > quoting it verbatim here: > > -8<- > DAX currently doesn't set errors in the mapping when cache flushing > fails in

Re: [PATCH 6/6] sd: add support for TCG OPAL self encrypting disks

2017-06-05 Thread Martin K. Petersen
Christoph, > +static void sd_read_security(struct scsi_disk *sdkp, unsigned char *buffer) > +{ > + struct scsi_device *sdev = sdkp->device; > + > + if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, > + SECURITY_PROTOCOL_IN) == 1 && > + scsi_report_opcode(sdev,

Re: [PATCH v4 10/11] blk-mq: clarify dispatch may not be drained/blocked by stopping queue

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > +/* > + * We do not guarantee that dispatch can be drained or blocked > + * after blk_mq_stop_hw_queue() returns. Please use > + * blk_mq_quiesce_queue() for that requirement. > + */ Hello Ming, This is comment explains what

Re: [PATCH v4 11/11] Revert "blk-mq: don't use sync workqueue flushing from drivers"

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > This patch reverts commit 2719aa217e0d02(blk-mq: don't use > sync workqueue flushing from drivers) because only > blk_mq_quiesce_queue() need the sync flush, and now > we don't need to stop queue any more, so revert it. > > Also changes to

Re: [PATCH v4 07/11] blk-mq: use QUEUE_FLAG_QUIESCED to quiesce queue

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > It is required that no dispatch can happen any more once > blk_mq_quiesce_queue() returns, and we don't have such requirement > on APIs of stopping queue. > > But blk_mq_quiesce_queue() still may not block/drain dispatch in the > the case of

Re: [PATCH v4 05/11] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > blk_mq_unquiesce_queue() is used for unquiescing the > queue explicitly, so replace blk_mq_start_stopped_hw_queues() > with it. Reviewed-by: Bart Van Assche

Re: [PATCH v4 04/11] blk-mq: introduce blk_mq_unquiesce_queue

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > blk_mq_start_stopped_hw_queues() is used implictely ^^ implicitly? > as counterpart of blk_mq_quiesce_queue() for unquiescing queue, > so we introduce

Re: [PATCH 6/6] sd: add support for TCG OPAL self encrypting disks

2017-06-05 Thread Scott Bauer
On Sun, Jun 04, 2017 at 02:42:25PM +0200, Christoph Hellwig wrote: > Just wire up the generic TCG OPAL infrastructure to the SCSI disk driver > and the Security In/Out commands. > > Note that I don't know of any actual SCSI disks that do support TCG OPAL, > but this is required to support ATA

Re: [PATCH v4 01/11] blk-mq: fix direct issue

2017-06-05 Thread Bart Van Assche
On Mon, 2017-06-05 at 23:59 +0800, Ming Lei wrote: > +static void __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, > + struct request *rq, > + blk_qc_t *cookie, bool may_sleep) > { > struct request_queue *q =

Re: Opal userspace

2017-06-05 Thread Scott Bauer
On Sun, Jun 04, 2017 at 09:15:03AM +0200, Christoph Hellwig wrote: > Hi Scott, > > is https://github.com/ScottyBauer/sed-opal-temp/ still the latest and > greatest in terms of OPAL userspace? The temp name always sounds a bit > odd.. Yeah it currently, is. I want to move it out from my personal

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Mon, Jun 05, 2017 at 11:47:33AM +0300, Rakesh Pandit wrote: > On Mon, Jun 05, 2017 at 11:44:34AM +0300, Rakesh Pandit wrote: > > On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > > > > > It would make sense to still add: > > > > > > > > if (ctrl->state == NVME_CTRL_DELETING

Re: TCG Opal support for libata

2017-06-05 Thread Tejun Heo
On Sun, Jun 04, 2017 at 02:42:19PM +0200, Christoph Hellwig wrote: > Hi all, > > this series adds support for using our new generic TCG OPAL code with > SATA disks, and as side effect for SCSI disks (although so far it doesn't > seem like none of those actually exist). Applied 1-5 to

[PATCH v4 11/11] Revert "blk-mq: don't use sync workqueue flushing from drivers"

2017-06-05 Thread Ming Lei
This patch reverts commit 2719aa217e0d02(blk-mq: don't use sync workqueue flushing from drivers) because only blk_mq_quiesce_queue() need the sync flush, and now we don't need to stop queue any more, so revert it. Also changes to cancel_delayed_work() in blk_mq_stop_hw_queue(). Signed-off-by:

[PATCH v4 09/11] blk-mq: don't stop queue for quiescing

2017-06-05 Thread Ming Lei
Queue can be started by other blk-mq APIs and can be used in different cases, this limits uses of blk_mq_quiesce_queue() if it is based on stopping queue, and make its usage very difficult, especially users have to use the stop queue APIs carefully for avoiding to break blk_mq_quiesce_queue(). We

[PATCH v4 10/11] blk-mq: clarify dispatch may not be drained/blocked by stopping queue

2017-06-05 Thread Ming Lei
BLK_MQ_S_STOPPED may not be observed in other concurrent I/O paths, we can't guarantee that dispatching won't happen after returning from the APIs of stopping queue. So clarify the fact and avoid potential misuse. Signed-off-by: Ming Lei --- block/blk-mq.c | 10 ++

[PATCH v4 07/11] blk-mq: use QUEUE_FLAG_QUIESCED to quiesce queue

2017-06-05 Thread Ming Lei
It is required that no dispatch can happen any more once blk_mq_quiesce_queue() returns, and we don't have such requirement on APIs of stopping queue. But blk_mq_quiesce_queue() still may not block/drain dispatch in the the case of BLK_MQ_S_START_ON_RUN, so use the new introduced flag of

[PATCH v4 08/11] blk-mq: update comments on blk_mq_quiesce_queue()

2017-06-05 Thread Ming Lei
Actually what we want to get from blk_mq_quiesce_queue() isn't only to wait for completion of all ongoing .queue_rq(). In the typical context of canceling requests, we need to make sure that the following is done in the dispatch path before starting to cancel requests: - failed

[PATCH v4 05/11] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-06-05 Thread Ming Lei
blk_mq_unquiesce_queue() is used for unquiescing the queue explicitly, so replace blk_mq_start_stopped_hw_queues() with it. For the scsi part, this patch takes Bart's suggestion to switch to block quiesce/unquiesce API completely. Cc: linux-n...@lists.infradead.org Cc: linux-s...@vger.kernel.org

[PATCH v4 06/11] nvme: host: unquiesce queue in nvme_kill_queues()

2017-06-05 Thread Ming Lei
When nvme_kill_queues() is run, queues may be in quiesced state, so we forcibly unquiesce queues to avoid blocking dispatch, and I/O hang can be avoided in remove path. Peviously we use blk_mq_start_stopped_hw_queues() as counterpart of blk_mq_quiesce_queue(), now we have introduced

[PATCH v4 04/11] blk-mq: introduce blk_mq_unquiesce_queue

2017-06-05 Thread Ming Lei
blk_mq_start_stopped_hw_queues() is used implictely as counterpart of blk_mq_quiesce_queue() for unquiescing queue, so we introduce blk_mq_unquiesce_queue() and make it as counterpart of blk_mq_quiesce_queue() explicitely. This function is for improving the current quiescing mechanism in the

[PATCH v4 03/11] blk-mq: introduce blk_mq_quiesce_queue_nowait()

2017-06-05 Thread Ming Lei
This patch introduces blk_mq_quiesce_queue_nowait() so that we can workaround mpt3sas for quiescing its queue. Once mpt3sas is fixed, we can remove this helper. Signed-off-by: Ming Lei --- include/linux/blk-mq.h | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v4 00/11] blk-mq: fix & improve queue quiescing

2017-06-05 Thread Ming Lei
Hi, There is one big issue in current blk_mq_quiesce_queue(): - in case of direct issue or BLK_MQ_S_START_ON_RUN, dispatch won't be prevented after blk_mq_quiesce_queue() is returned. The 1st patch fixes the problem in direct issue, please consider it for v4.12. The other 10 patches

[PATCH v4 01/11] blk-mq: fix direct issue

2017-06-05 Thread Ming Lei
If queue is stopped, we shouldn't dispatch request into driver and hardware, unfortunately the check is removed in bd166ef183c2(blk-mq-sched: add framework for MQ capable IO schedulers). This patch fixes the issue by moving the check back into __blk_mq_try_issue_directly(). This patch fixes

[PATCH v4 02/11] blk-mq: move blk_mq_quiesce_queue() into include/linux/blk-mq.h

2017-06-05 Thread Ming Lei
We usually put blk_mq_*() into include/linux/blk-mq.h, so move this API into there. Signed-off-by: Ming Lei --- include/linux/blk-mq.h | 1 + include/linux/blkdev.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/blk-mq.h

[PATCH v4 00/11] blk-mq: fix & improve queue quiescing

2017-06-05 Thread Ming Lei
Hi, There is one big issue in current blk_mq_quiesce_queue(): - in case of direct issue or BLK_MQ_S_START_ON_RUN, dispatch won't be prevented after blk_mq_quiesce_queue() is returned. The 1st patch fixes the problem in direct issue, please consider it for v4.12. The other 10 patches

Re: [PATCH 07/10] fs: return on congested block device

2017-06-05 Thread Jens Axboe
On 06/04/2017 11:35 PM, Goldwyn Rodrigues wrote: > @@ -1900,6 +1905,17 @@ generic_make_request_checks(struct bio *bio) > goto end_io; > } > > + /* > + * For a REQ_NOWAIT based request, return -EOPNOTSUPP > + * if queue does not have QUEUE_FLAG_NOWAIT_SUPPORT set

Re: [PATCH 4/6] libata: factor out a ata_identify_page_supported helper

2017-06-05 Thread Sergei Shtylyov
Hello! On 06/04/2017 03:42 PM, Christoph Hellwig wrote: Signed-off-by: Christoph Hellwig --- drivers/ata/libata-core.c | 59 +-- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/drivers/ata/libata-core.c

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Mon, Jun 05, 2017 at 11:44:34AM +0300, Rakesh Pandit wrote: > On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > > > It would make sense to still add: > > > > > > if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD) > > > return > > > > > > inside

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Rakesh Pandit
On Sun, Jun 04, 2017 at 06:24:09PM +0300, Sagi Grimberg wrote: > > > It would make sense to still add: > > > > if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD) > > return > > > > inside nvme_configure_apst at the top irrespective of this change. > > I'm not sure what

Re: [PATCH] nvme: fix hang in remove path

2017-06-05 Thread Christoph Hellwig
Thanks Ming, I'll add this to the nvme tree for 4.12-rc.

[PATCH BUGFIX] block, bfq: access and cache blkg data only when safe

2017-06-05 Thread Paolo Valente
In blk-cgroup, operations on blkg objects are protected with the request_queue lock. This is no more the lock that protects I/O-scheduler operations in blk-mq. In fact, the latter are now protected with a finer-grained per-scheduler-instance lock. As a consequence, although blkg lookups are also

Application stops due to ext4 filesytsem IO error

2017-06-05 Thread Sumit Saxena
Jens, We am observing application stops while running ext4 filesystem IOs along with target reset in parallel. Our suspect is this behavior can be attributed to linux block layer. See below for details- Problem statement - " Application stops due to IO error from file system buffered IO. (Note