flush_end_io() currently decrement request refcount unconditionally.
However, it's possible that the request is already idle and it's
refcount is zero since that flush_end_io() can be called concurrently.
For example, nbd_clear_que() can be called concurrently with normal
io completion or io timeout.
Thus check idle before decrement to avoid refcount_t underflow
warning.
Signed-off-by: Yu Kuai <redacted>
---
block/blk-flush.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
On Sun, Aug 08, 2021 at 03:03:30PM +0800, Yu Kuai wrote:
quoted hunk
flush_end_io() currently decrement request refcount unconditionally.
However, it's possible that the request is already idle and it's
refcount is zero since that flush_end_io() can be called concurrently.
For example, nbd_clear_que() can be called concurrently with normal
io completion or io timeout.
Thus check idle before decrement to avoid refcount_t underflow
warning.
Signed-off-by: Yu Kuai <redacted>
---
block/blk-flush.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Hi, jens
Can you please consider to apply this patch?
Thanks
Kuai
On 2021/08/08 15:03, Yu Kuai wrote:
quoted hunk
flush_end_io() currently decrement request refcount unconditionally.
However, it's possible that the request is already idle and it's
refcount is zero since that flush_end_io() can be called concurrently.
For example, nbd_clear_que() can be called concurrently with normal
io completion or io timeout.
Thus check idle before decrement to avoid refcount_t underflow
warning.
Signed-off-by: Yu Kuai <redacted>
---
block/blk-flush.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Please ignore this email, I reply to the wrong wmail.
Sincerely apologize
Kuai
在 2021/08/13 17:40, yukuai (C) 写道:
Hi, jens
Can you please consider to apply this patch?
Thanks
Kuai
On 2021/08/08 15:03, Yu Kuai wrote:
quoted
flush_end_io() currently decrement request refcount unconditionally.
However, it's possible that the request is already idle and it's
refcount is zero since that flush_end_io() can be called concurrently.
For example, nbd_clear_que() can be called concurrently with normal
io completion or io timeout.
Thus check idle before decrement to avoid refcount_t underflow
warning.
Signed-off-by: Yu Kuai <redacted>
---
block/blk-flush.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)