Re: [PATCH net 3/3] net/smc: Resolve the race between SMC-R link access and clear

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your review.

On 2022/1/11 4:40 pm, Karsten Graul wrote:
On 10/01/2022 10:26, Wen Gu wrote:
@@ -1226,15 +1245,23 @@ void smcr_link_clear(struct smc_link *lnk, bool log)
  	smc_wr_free_link(lnk);
  	smc_ib_destroy_queue_pair(lnk);
  	smc_ib_dealloc_protection_domain(lnk);
-	smc_wr_free_link_mem(lnk);
-	smc_lgr_put(lnk->lgr); /* lgr_hold in smcr_link_init() */
  	smc_ibdev_cnt_dec(lnk);
  	put_device(&lnk->smcibdev->ibdev->dev);
  	smcibdev = lnk->smcibdev;
-	memset(lnk, 0, sizeof(struct smc_link));
-	lnk->state = SMC_LNK_UNUSED;
  	if (!atomic_dec_return(&smcibdev->lnk_cnt))
  		wake_up(&smcibdev->lnks_deleted);

Same here, waiter should not be woken up until the link memory is actually freed.


OK, I will correct this as well.

And similarly I want to move smc_ibdev_cnt_dec() and put_device() to
__smcr_link_clear() as well to ensure that put link related resources
only when link is actually cleared. What do you think?

Thanks,
Wen Gu



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux