Message ID | 20191003014310.13262-4-paulmck@kernel.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | None | expand |
Paul, No objections from me. > + vpd_pg80 = rcu_replace(sdev->vpd_pg80, vpd_pg80, > + lockdep_is_held(&sdev->inquiry_mutex)); > + vpd_pg83 = rcu_replace(sdev->vpd_pg83, vpd_pg83, > + lockdep_is_held(&sdev->inquiry_mutex)); Just a heads-up that we have added a couple of additional VPD pages so my 5.5 tree will need additional calls to be updated to rcu_replace().
On Thu, Oct 03, 2019 at 10:09:31PM -0400, Martin K. Petersen wrote: > > Paul, > > No objections from me. Thank you, Martin! I have applied your Acked-by, but please let me know if that over-interprets your "No objections" above. > > + vpd_pg80 = rcu_replace(sdev->vpd_pg80, vpd_pg80, > > + lockdep_is_held(&sdev->inquiry_mutex)); > > + vpd_pg83 = rcu_replace(sdev->vpd_pg83, vpd_pg83, > > + lockdep_is_held(&sdev->inquiry_mutex)); > > Just a heads-up that we have added a couple of additional VPD pages so > my 5.5 tree will need additional calls to be updated to rcu_replace(). I do not intend to actually remove rcu_swap_protected() until 5.6 for exactly this sort of thing. My plan is to take another pass through the tree after 5.5 comes out, and these will be caught at that time. Does that work for you? Thanx, Paul
Paul, > I do not intend to actually remove rcu_swap_protected() until 5.6 for > exactly this sort of thing. My plan is to take another pass through > the tree after 5.5 comes out, and these will be caught at that time. > > Does that work for you? Yep, that's great. Thanks!
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 1f5b5c8..6a38d4a 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -434,8 +434,8 @@ static void scsi_update_vpd_page(struct scsi_device *sdev, u8 page, return; mutex_lock(&sdev->inquiry_mutex); - rcu_swap_protected(*sdev_vpd_buf, vpd_buf, - lockdep_is_held(&sdev->inquiry_mutex)); + vpd_buf = rcu_replace(*sdev_vpd_buf, vpd_buf, + lockdep_is_held(&sdev->inquiry_mutex)); mutex_unlock(&sdev->inquiry_mutex); if (vpd_buf) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 64c96c7..8d17779 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -466,10 +466,10 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work) sdev->request_queue = NULL; mutex_lock(&sdev->inquiry_mutex); - rcu_swap_protected(sdev->vpd_pg80, vpd_pg80, - lockdep_is_held(&sdev->inquiry_mutex)); - rcu_swap_protected(sdev->vpd_pg83, vpd_pg83, - lockdep_is_held(&sdev->inquiry_mutex)); + vpd_pg80 = rcu_replace(sdev->vpd_pg80, vpd_pg80, + lockdep_is_held(&sdev->inquiry_mutex)); + vpd_pg83 = rcu_replace(sdev->vpd_pg83, vpd_pg83, + lockdep_is_held(&sdev->inquiry_mutex)); mutex_unlock(&sdev->inquiry_mutex); if (vpd_pg83)