Re: [PATCH v9 08/11] scsi: sd_zbc: emulate ZONE_APPEND commands
From: Martin K. Petersen <hidden>
Date: 2020-05-06 03:22:08
Also in:
linux-fsdevel, linux-scsi
Johannes,
quoted hunk
@@ -3665,19 +3679,19 @@ static int __init init_sd(void) if (!sd_page_pool) { printk(KERN_ERR "sd: can't init discard page pool\n"); err = -ENOMEM; - goto err_out_ppool; + goto err_out_cdb_pool; } err = scsi_register_driver(&sd_template.gendrv); if (err) - goto err_out_driver; + goto err_out_ppool; return 0; -err_out_driver: +err_out_ppool: mempool_destroy(sd_page_pool); -err_out_ppool: +err_out_cdb_pool: mempool_destroy(sd_cdb_pool); err_out_cache:
This change seems unrelated!?
quoted hunk
--- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h@@ -79,6 +79,12 @@ struct scsi_disk { u32 zones_optimal_open; u32 zones_optimal_nonseq; u32 zones_max_open; + u32 *zones_wp_ofst; + spinlock_t zones_wp_ofst_lock; + u32 *rev_wp_ofst; + struct mutex rev_mutex; + struct work_struct zone_wp_ofst_work; + char *zone_wp_update_buf;
I agree with the comments about ofst making things harder to read. OFST could just as easily have been a new SCSI protocol knob. My preference is to spell it out as "offset" so it is crystal clear what it describes, and massage the code accordingly.
+ /*FALLTHRU*/
fallthrough; to please the static checkers.
+ case REQ_OP_ZONE_APPEND: + rq->__sector += sdkp->zones_wp_ofst[zno]; + /* fallthrough */
One more fallthrough; Otherwise this looks OK. Reviewed-by: Martin K. Petersen <redacted> -- Martin K. Petersen Oracle Linux Engineering