diff mbox series

[2/3] ublk_drv: update comment for __ublk_fail_req()

Message ID 20220809091629.104682-3-ZiyangZhang@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series ublk_drv: cleanup and bugfix | expand

Commit Message

Ziyang Zhang Aug. 9, 2022, 9:16 a.m. UTC
Since __ublk_rq_task_work always fails requests immediately during
exiting, __ublk_fail_req() is only called from abort context during
exiting. So lock is unnecessary.

Signed-off-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
---
 drivers/block/ublk_drv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Ming Lei Aug. 13, 2022, 10:24 a.m. UTC | #1
On Tue, Aug 9, 2022 at 5:18 PM ZiyangZhang
<ZiyangZhang@linux.alibaba.com> wrote:
>
> Since __ublk_rq_task_work always fails requests immediately during
> exiting, __ublk_fail_req() is only called from abort context during
> exiting. So lock is unnecessary.
>
> Signed-off-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
> ---
>  drivers/block/ublk_drv.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 3797bd64c3c3..bedef46f6abf 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -605,11 +605,9 @@ static void ublk_complete_rq(struct request *req)
>  }
>
>  /*
> - * __ublk_fail_req() may be called from abort context or ->ubq_daemon
> - * context during exiting, so lock is required.
> - *
> - * Also aborting may not be started yet, keep in mind that one failed
> - * request may be issued by block layer again.

I'd suggest to keep the above two lines, since that is the exact issue
in patch 3.

Thanks,
diff mbox series

Patch

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 3797bd64c3c3..bedef46f6abf 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -605,11 +605,9 @@  static void ublk_complete_rq(struct request *req)
 }
 
 /*
- * __ublk_fail_req() may be called from abort context or ->ubq_daemon
- * context during exiting, so lock is required.
- *
- * Also aborting may not be started yet, keep in mind that one failed
- * request may be issued by block layer again.
+ * Since __ublk_rq_task_work always fails requests immediately during
+ * exiting, __ublk_fail_req() is only called from abort context during
+ * exiting. So lock is unnecessary.
  */
 static void __ublk_fail_req(struct ublk_io *io, struct request *req)
 {