diff mbox series

[V2,2/2] block: allow zone_mgmt_ops to bail out on SIGKILL

Message ID 20191111211844.5922-3-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: allow zone_mgmt_ops to bail out on SIGKILL | expand

Commit Message

Chaitanya Kulkarni Nov. 11, 2019, 9:18 p.m. UTC
This patch is on the similar concept which is posted earlier:-
https://marc.info/?l=linux-block&m=157321402002207&w=2.

This allows zone-mgmt ops to handle SIGKILL.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-zoned.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Damien Le Moal Nov. 12, 2019, 12:04 a.m. UTC | #1
On 2019/11/12 6:18, Chaitanya Kulkarni wrote:
> This patch is on the similar concept which is posted earlier:-
> https://marc.info/?l=linux-block&m=157321402002207&w=2.

May be reference a commit ID here instead of an URL ?

> 
> This allows zone-mgmt ops to handle SIGKILL.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  block/blk-zoned.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index 481eaf7d04d4..8f0f740d89e8 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -286,12 +286,15 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
>  		sector += zone_sectors;
>  
>  		/* This may take a while, so be nice to others */
> -		cond_resched();
> +		ret = blk_should_abort(bio);
> +		if (ret)
> +			goto out;

There is no need for the goto here. You can return directly.

>  	}
>  
>  	ret = submit_bio_wait(bio);
>  	bio_put(bio);
>  
> +out:
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(blkdev_zone_mgmt);
>
Chaitanya Kulkarni Nov. 12, 2019, 3:53 a.m. UTC | #2
On 11/11/2019 04:04 PM, Damien Le Moal wrote:
> On 2019/11/12 6:18, Chaitanya Kulkarni wrote:
>> This patch is on the similar concept which is posted earlier:-
>> https://marc.info/?l=linux-block&m=157321402002207&w=2.
>
> May be reference a commit ID here instead of an URL ?
>
With reference to the cover-letter  I couldn't find this commit in
the repo (on for-next branch), waiting for Jens to respond if he wants
me to bundle these patches with the original in one series.

>>
>> This allows zone-mgmt ops to handle SIGKILL.
>>
>> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
>> ---
>>   block/blk-zoned.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
>> index 481eaf7d04d4..8f0f740d89e8 100644
>> --- a/block/blk-zoned.c
>> +++ b/block/blk-zoned.c
>> @@ -286,12 +286,15 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
>>   		sector += zone_sectors;
>>
>>   		/* This may take a while, so be nice to others */
>> -		cond_resched();
>> +		ret = blk_should_abort(bio);
>> +		if (ret)
>> +			goto out;
>
> There is no need for the goto here. You can return directly.
>
Okay.
>>   	}
>>
>>   	ret = submit_bio_wait(bio);
>>   	bio_put(bio);
>>
>> +out:
>>   	return ret;
>>   }
>>   EXPORT_SYMBOL_GPL(blkdev_zone_mgmt);
>>
>
>
Jens Axboe Nov. 14, 2019, 9:02 p.m. UTC | #3
On 11/11/19 8:53 PM, Chaitanya Kulkarni wrote:
> On 11/11/2019 04:04 PM, Damien Le Moal wrote:
>> On 2019/11/12 6:18, Chaitanya Kulkarni wrote:
>>> This patch is on the similar concept which is posted earlier:-
>>> https://marc.info/?l=linux-block&m=157321402002207&w=2.
>>
>> May be reference a commit ID here instead of an URL ?
>>
> With reference to the cover-letter  I couldn't find this commit in
> the repo (on for-next branch), waiting for Jens to respond if he wants
> me to bundle these patches with the original in one series.

It's not added yet, there was still discussion around it. Someone needs
to followup on that one.

But in general, don't make commit messages just a link, that's not
a good commit message.
diff mbox series

Patch

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 481eaf7d04d4..8f0f740d89e8 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -286,12 +286,15 @@  int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
 		sector += zone_sectors;
 
 		/* This may take a while, so be nice to others */
-		cond_resched();
+		ret = blk_should_abort(bio);
+		if (ret)
+			goto out;
 	}
 
 	ret = submit_bio_wait(bio);
 	bio_put(bio);
 
+out:
 	return ret;
 }
 EXPORT_SYMBOL_GPL(blkdev_zone_mgmt);