* Re: [RFC] nilfs2: double bio_put() in nilfs_end_bio_write()
2013-07-19 9:26 [RFC] nilfs2: double bio_put() in nilfs_end_bio_write() Dan Carpenter
@ 2013-07-20 9:10 ` Vyacheslav Dubeyko
2013-07-20 21:40 ` Dan Carpenter
2013-07-21 12:50 ` Vyacheslav Dubeyko
2 siblings, 0 replies; 4+ messages in thread
From: Vyacheslav Dubeyko @ 2013-07-20 9:10 UTC (permalink / raw)
To: kernel-janitors
Hi Dan,
On Jul 19, 2013, at 1:26 PM, Dan Carpenter wrote:
> I don't know if this is correct or not, but if feels like we shouldn't
> be calling bio_put() twice in nilfs_end_bio_write(). Also the comment
> is out of date. If this is correct then I can resend with a proper
> Signed-off-by line and everything.
>
I think that you have caught the important issue.
> diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
> index dc9a913..a660fd7 100644
> --- a/fs/nilfs2/segbuf.c
> +++ b/fs/nilfs2/segbuf.c
> @@ -346,7 +346,8 @@ static void nilfs_end_bio_write(struct bio *bio, int err)
> if (err = -EOPNOTSUPP) {
> set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
> bio_put(bio);
> - /* to be detected by submit_seg_bio() */
> + /* to be detected by nilfs_segbuf_submit_bio() */
> + return;
I think that simple return from the function is not right way. As I understand the code,
then we increment error count in segbuf's sb_err field and signalize about completion of
operation. So, from my viewpoint, it needs to remove the bio_put() call for the case of
(err = -EOPNOTSUPP) instead of return from function.
Thanks,
Vyacheslav Dubeyko.
> }
>
> if (!uptodate)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFC] nilfs2: double bio_put() in nilfs_end_bio_write()
2013-07-19 9:26 [RFC] nilfs2: double bio_put() in nilfs_end_bio_write() Dan Carpenter
2013-07-20 9:10 ` Vyacheslav Dubeyko
@ 2013-07-20 21:40 ` Dan Carpenter
2013-07-21 12:50 ` Vyacheslav Dubeyko
2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-07-20 21:40 UTC (permalink / raw)
To: kernel-janitors
On Sat, Jul 20, 2013 at 01:10:23PM +0400, Vyacheslav Dubeyko wrote:
> > diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
> > index dc9a913..a660fd7 100644
> > --- a/fs/nilfs2/segbuf.c
> > +++ b/fs/nilfs2/segbuf.c
> > @@ -346,7 +346,8 @@ static void nilfs_end_bio_write(struct bio *bio, int err)
> > if (err = -EOPNOTSUPP) {
> > set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
> > bio_put(bio);
> > - /* to be detected by submit_seg_bio() */
> > + /* to be detected by nilfs_segbuf_submit_bio() */
> > + return;
>
> I think that simple return from the function is not right way. As I understand the code,
> then we increment error count in segbuf's sb_err field and signalize about completion of
> operation. So, from my viewpoint, it needs to remove the bio_put() call for the case of
> (err = -EOPNOTSUPP) instead of return from function.
>
Do you think you could send that patch and give me a reported-by
tag? I feel weird signing off on it when I don't really understand
this code...
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFC] nilfs2: double bio_put() in nilfs_end_bio_write()
2013-07-19 9:26 [RFC] nilfs2: double bio_put() in nilfs_end_bio_write() Dan Carpenter
2013-07-20 9:10 ` Vyacheslav Dubeyko
2013-07-20 21:40 ` Dan Carpenter
@ 2013-07-21 12:50 ` Vyacheslav Dubeyko
2 siblings, 0 replies; 4+ messages in thread
From: Vyacheslav Dubeyko @ 2013-07-21 12:50 UTC (permalink / raw)
To: kernel-janitors
On Jul 21, 2013, at 1:40 AM, Dan Carpenter wrote:
> On Sat, Jul 20, 2013 at 01:10:23PM +0400, Vyacheslav Dubeyko wrote:
>>> diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
>>> index dc9a913..a660fd7 100644
>>> --- a/fs/nilfs2/segbuf.c
>>> +++ b/fs/nilfs2/segbuf.c
>>> @@ -346,7 +346,8 @@ static void nilfs_end_bio_write(struct bio *bio, int err)
>>> if (err = -EOPNOTSUPP) {
>>> set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
>>> bio_put(bio);
>>> - /* to be detected by submit_seg_bio() */
>>> + /* to be detected by nilfs_segbuf_submit_bio() */
>>> + return;
>>
>> I think that simple return from the function is not right way. As I understand the code,
>> then we increment error count in segbuf's sb_err field and signalize about completion of
>> operation. So, from my viewpoint, it needs to remove the bio_put() call for the case of
>> (err = -EOPNOTSUPP) instead of return from function.
>>
>
> Do you think you could send that patch and give me a reported-by
> tag? I feel weird signing off on it when I don't really understand
> this code...
>
Ok, sure. I'll send the patch and continue discussion with Ryusuke
(if he will have objections).
Thank you for the report and fix suggestion.
With the best regards,
Vyacheslav Dubeyko.
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread