diff mbox series

lightnvm: pblk: fix chunk close trace event check

Message ID 1540541544-7761-1-git-send-email-hans.holmberg@cnexlabs.com (mailing list archive)
State New, archived
Headers show
Series lightnvm: pblk: fix chunk close trace event check | expand

Commit Message

Hans Holmberg Oct. 26, 2018, 8:12 a.m. UTC
The check for chunk closes suffers from an off-by-one issue, leading
to chunk close events not being traced. Fix this.

Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
---

 drivers/lightnvm/pblk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matias Bjorling Oct. 26, 2018, 6:49 p.m. UTC | #1
On 10/26/2018 10:12 AM, Hans Holmberg wrote:
> The check for chunk closes suffers from an off-by-one issue, leading
> to chunk close events not being traced. Fix this.
> 
> Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> ---
> 
>   drivers/lightnvm/pblk-core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 6944aac43b01..6581c35f51ee 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -531,7 +531,7 @@ void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd)
>   		if (caddr == 0)
>   			trace_pblk_chunk_state(pblk_disk_name(pblk),
>   							ppa, NVM_CHK_ST_OPEN);
> -		else if (caddr == chunk->cnlb)
> +		else if (caddr == (chunk->cnlb - 1))
>   			trace_pblk_chunk_state(pblk_disk_name(pblk),
>   							ppa, NVM_CHK_ST_CLOSED);
>   	}
> 

Thanks Hans, Applied for 4.21/5.1. Note that you're sending from your 
owntronix email account. Checkpatch complains that sender and author 
doesn't match.
Hans Holmberg Oct. 29, 2018, 9:56 a.m. UTC | #2
On Fri, Oct 26, 2018 at 8:49 PM Matias Bjørling <mb@lightnvm.io> wrote:
>
> On 10/26/2018 10:12 AM, Hans Holmberg wrote:
> > The check for chunk closes suffers from an off-by-one issue, leading
> > to chunk close events not being traced. Fix this.
> >
> > Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")
> >
> > Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> > ---
> >
> >   drivers/lightnvm/pblk-core.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> > index 6944aac43b01..6581c35f51ee 100644
> > --- a/drivers/lightnvm/pblk-core.c
> > +++ b/drivers/lightnvm/pblk-core.c
> > @@ -531,7 +531,7 @@ void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd)
> >               if (caddr == 0)
> >                       trace_pblk_chunk_state(pblk_disk_name(pblk),
> >                                                       ppa, NVM_CHK_ST_OPEN);
> > -             else if (caddr == chunk->cnlb)
> > +             else if (caddr == (chunk->cnlb - 1))
> >                       trace_pblk_chunk_state(pblk_disk_name(pblk),
> >                                                       ppa, NVM_CHK_ST_CLOSED);
> >       }
> >
>
> Thanks Hans, Applied for 4.21/5.1. Note that you're sending from your
> owntronix email account. Checkpatch complains that sender and author
> doesn't match.

Ah, I must have messed up my git configuration.
Would you mind updating the patch author to "Hans Holmberg
<hans.holmberg@cnexlabs.com>" in for-4.21/core?

Thanks,
Hans
Matias Bjorling Oct. 29, 2018, 11:14 a.m. UTC | #3
On 10/29/2018 10:56 AM, Hans Holmberg wrote:
> On Fri, Oct 26, 2018 at 8:49 PM Matias Bjørling <mb@lightnvm.io> wrote:
>>
>> On 10/26/2018 10:12 AM, Hans Holmberg wrote:
>>> The check for chunk closes suffers from an off-by-one issue, leading
>>> to chunk close events not being traced. Fix this.
>>>
>>> Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")
>>>
>>> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
>>> ---
>>>
>>>    drivers/lightnvm/pblk-core.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
>>> index 6944aac43b01..6581c35f51ee 100644
>>> --- a/drivers/lightnvm/pblk-core.c
>>> +++ b/drivers/lightnvm/pblk-core.c
>>> @@ -531,7 +531,7 @@ void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd)
>>>                if (caddr == 0)
>>>                        trace_pblk_chunk_state(pblk_disk_name(pblk),
>>>                                                        ppa, NVM_CHK_ST_OPEN);
>>> -             else if (caddr == chunk->cnlb)
>>> +             else if (caddr == (chunk->cnlb - 1))
>>>                        trace_pblk_chunk_state(pblk_disk_name(pblk),
>>>                                                        ppa, NVM_CHK_ST_CLOSED);
>>>        }
>>>
>>
>> Thanks Hans, Applied for 4.21/5.1. Note that you're sending from your
>> owntronix email account. Checkpatch complains that sender and author
>> doesn't match.
> 
> Ah, I must have messed up my git configuration.
> Would you mind updating the patch author to "Hans Holmberg
> <hans.holmberg@cnexlabs.com>" in for-4.21/core?
> 
> Thanks,
> Hans
> 

Will do. Thanks.
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 6944aac43b01..6581c35f51ee 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -531,7 +531,7 @@  void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd)
 		if (caddr == 0)
 			trace_pblk_chunk_state(pblk_disk_name(pblk),
 							ppa, NVM_CHK_ST_OPEN);
-		else if (caddr == chunk->cnlb)
+		else if (caddr == (chunk->cnlb - 1))
 			trace_pblk_chunk_state(pblk_disk_name(pblk),
 							ppa, NVM_CHK_ST_CLOSED);
 	}