diff mbox series

[7/7] bcache: fix a regression of code compiling failure in debug.c

Message ID 20210411134316.80274-8-colyli@suse.de (mailing list archive)
State New, archived
Headers show
Series bcache patches for Linux 5.13 -- 1st wave | expand

Commit Message

Coly Li April 11, 2021, 1:43 p.m. UTC
The patch "bcache: remove PTR_CACHE" introduces a compiling failure in
debug.c with following error message,
  In file included from drivers/md/bcache/bcache.h:182:0,
                   from drivers/md/bcache/debug.c:9:
  drivers/md/bcache/debug.c: In function 'bch_btree_verify':
  drivers/md/bcache/debug.c:53:19: error: 'c' undeclared (first use in
  this function)
    bio_set_dev(bio, c->cache->bdev);
                     ^
This patch fixes the regression by replacing c->cache->bdev by b->c->
cache->bdev.

Signed-off-by: Coly Li <colyli@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/md/bcache/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig April 12, 2021, 9:06 a.m. UTC | #1
On Sun, Apr 11, 2021 at 09:43:16PM +0800, Coly Li wrote:
> The patch "bcache: remove PTR_CACHE" introduces a compiling failure in
> debug.c with following error message,
>   In file included from drivers/md/bcache/bcache.h:182:0,
>                    from drivers/md/bcache/debug.c:9:
>   drivers/md/bcache/debug.c: In function 'bch_btree_verify':
>   drivers/md/bcache/debug.c:53:19: error: 'c' undeclared (first use in
>   this function)
>     bio_set_dev(bio, c->cache->bdev);
>                      ^
> This patch fixes the regression by replacing c->cache->bdev by b->c->
> cache->bdev.

Why not fold this into the offending patch?
Coly Li April 12, 2021, 9:53 a.m. UTC | #2
On 4/12/21 5:06 PM, Christoph Hellwig wrote:
> On Sun, Apr 11, 2021 at 09:43:16PM +0800, Coly Li wrote:
>> The patch "bcache: remove PTR_CACHE" introduces a compiling failure in
>> debug.c with following error message,
>>   In file included from drivers/md/bcache/bcache.h:182:0,
>>                    from drivers/md/bcache/debug.c:9:
>>   drivers/md/bcache/debug.c: In function 'bch_btree_verify':
>>   drivers/md/bcache/debug.c:53:19: error: 'c' undeclared (first use in
>>   this function)
>>     bio_set_dev(bio, c->cache->bdev);
>>                      ^
>> This patch fixes the regression by replacing c->cache->bdev by b->c->
>> cache->bdev.
> 
> Why not fold this into the offending patch?
> 

I don't know whether I can do it without authorization or agreement from
original author. And I see other maintainers handling similar situation
by either re-write whole patch or appending an extra fix.

If you have a suggested process, I can try it out next time for similar
situation.

Coly Li
Jens Axboe April 12, 2021, 12:50 p.m. UTC | #3
On 4/12/21 3:53 AM, Coly Li wrote:
> On 4/12/21 5:06 PM, Christoph Hellwig wrote:
>> On Sun, Apr 11, 2021 at 09:43:16PM +0800, Coly Li wrote:
>>> The patch "bcache: remove PTR_CACHE" introduces a compiling failure in
>>> debug.c with following error message,
>>>   In file included from drivers/md/bcache/bcache.h:182:0,
>>>                    from drivers/md/bcache/debug.c:9:
>>>   drivers/md/bcache/debug.c: In function 'bch_btree_verify':
>>>   drivers/md/bcache/debug.c:53:19: error: 'c' undeclared (first use in
>>>   this function)
>>>     bio_set_dev(bio, c->cache->bdev);
>>>                      ^
>>> This patch fixes the regression by replacing c->cache->bdev by b->c->
>>> cache->bdev.
>>
>> Why not fold this into the offending patch?
>>
> 
> I don't know whether I can do it without authorization or agreement from
> original author. And I see other maintainers handling similar situation
> by either re-write whole patch or appending an extra fix.
> 
> If you have a suggested process, I can try it out next time for similar
> situation.

What I generally do is just add a line between the SOB's for cases
like this, ala:

commit 70aacfe66136809d7f080f89c492c278298719f4
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Mon Mar 1 13:02:15 2021 +0000

    io_uring: kill sqo_dead and sqo submission halting
    
    As SQPOLL task doesn't poke into ->sqo_task anymore, there is no need to
    kill the sqo when the master task exits. Before it was necessary to
    avoid races accessing sqo_task->files with removing them.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    [axboe: don't forget to enable SQPOLL before exit, if started disabled]
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
Coly Li April 12, 2021, 1:13 p.m. UTC | #4
On 4/12/21 8:50 PM, Jens Axboe wrote:
> On 4/12/21 3:53 AM, Coly Li wrote:
>> On 4/12/21 5:06 PM, Christoph Hellwig wrote:
>>> On Sun, Apr 11, 2021 at 09:43:16PM +0800, Coly Li wrote:
>>>> The patch "bcache: remove PTR_CACHE" introduces a compiling failure in
>>>> debug.c with following error message,
>>>>   In file included from drivers/md/bcache/bcache.h:182:0,
>>>>                    from drivers/md/bcache/debug.c:9:
>>>>   drivers/md/bcache/debug.c: In function 'bch_btree_verify':
>>>>   drivers/md/bcache/debug.c:53:19: error: 'c' undeclared (first use in
>>>>   this function)
>>>>     bio_set_dev(bio, c->cache->bdev);
>>>>                      ^
>>>> This patch fixes the regression by replacing c->cache->bdev by b->c->
>>>> cache->bdev.
>>>
>>> Why not fold this into the offending patch?
>>>
>>
>> I don't know whether I can do it without authorization or agreement from
>> original author. And I see other maintainers handling similar situation
>> by either re-write whole patch or appending an extra fix.
>>
>> If you have a suggested process, I can try it out next time for similar
>> situation.
> 
> What I generally do is just add a line between the SOB's for cases
> like this, ala:
> 
> commit 70aacfe66136809d7f080f89c492c278298719f4
> Author: Pavel Begunkov <asml.silence@gmail.com>
> Date:   Mon Mar 1 13:02:15 2021 +0000
> 
>     io_uring: kill sqo_dead and sqo submission halting
>     
>     As SQPOLL task doesn't poke into ->sqo_task anymore, there is no need to
>     kill the sqo when the master task exits. Before it was necessary to
>     avoid races accessing sqo_task->files with removing them.
>     
>     Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>     [axboe: don't forget to enable SQPOLL before exit, if started disabled]
>     Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 

This is a new skill to me. Thanks for the hint, I will use such method
to handle similar situation next time.

Coly Li
diff mbox series

Patch

diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 589a052efeb1..116edda845c3 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -50,7 +50,7 @@  void bch_btree_verify(struct btree *b)
 	v->keys.ops = b->keys.ops;
 
 	bio = bch_bbio_alloc(b->c);
-	bio_set_dev(bio, c->cache->bdev);
+	bio_set_dev(bio, b->c->cache->bdev);
 	bio->bi_iter.bi_sector	= PTR_OFFSET(&b->key, 0);
 	bio->bi_iter.bi_size	= KEY_SIZE(&v->key) << 9;
 	bio->bi_opf		= REQ_OP_READ | REQ_META;