nilfs2: double bio_put() in nilfs_end_bio_write()
Subsystems (2)
RFC 1/1 nilfs2: double bio_put() in nilfs_end_bio_write()
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.
fs/nilfs2/segbuf.c +2 -1
@@ -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 ; }if (!uptodate)
Vyacheslav Dubeyko
maintainerHi Dan,
Quoted 5 lines · Dan Carpenter
I don't know if this is correct or not, but if feels like we shouldn't be calling
bio_put()twice innilfs_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.
fs/nilfs2/segbuf.c static void nilfs_end_bio_write(struct bio *bio, int err) · line 350
Quoted 11 lines
fs/nilfs2/segbuf.c +2
-1@@ -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.
Quoted 7 lines
fs/nilfs2/segbuf.c +0
-1}if (!uptodate) --To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Vyacheslav Dubeyko
Quoted 8 lines
fs/nilfs2/segbuf.c +0
-0@@ -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);
Quoted 9 lines
fs/nilfs2/segbuf.c static void nilfs_end_bio_write(struct bio *bio, int err) · line 350
Quoted 3 lines
fs/nilfs2/segbuf.c +2
-1-/* 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_errfield and signalize about completion of operation. So, from my viewpoint, it needs to remove thebio_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
Vyacheslav Dubeyko
maintainerQuoted 19 lines · Dan Carpenter
Quoted 8 lines · Vyacheslav Dubeyko
Quoted 8 lines
fs/nilfs2/segbuf.c +0
-0@@ -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);Quoted 9 lines
fs/nilfs2/segbuf.c static void nilfs_end_bio_write(struct bio *bio, int err) · line 350
Quoted 3 lines
fs/nilfs2/segbuf.c +2
-1-/* 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_errfield and signalize about completion of operation. So, from my viewpoint, it needs to remove thebio_put()call for the case of (err =-EOPNOTSUPP) instead of return from function.
Quoted 4 lines
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.
Quoted 2 lines
regards,
dan carpenter