Re: [PATCH v1] scsi: ufs: core: print trs for pending requests in MCQ mode

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

 



On 3/8/23 21:01, Ziqi Chen wrote:
+static void ufshcd_print_trs_all(struct ufs_hba *hba, bool pr_prdt)
+{
+	const struct ufshcd_lrb *lrbp;
+	int tag;
+
+	for (tag = 0; tag < hba->nutrs; tag++) {
+		lrbp = &hba->lrb[tag];
+
+		if (lrbp->cmd)
+			ufshcd_print_tr(hba, tag, pr_prdt);
  	}
  }

There is a race in this code: lrbp->cmd may be cleared after it has been read and before or while ufshcd_print_tr() is in progress. How about preventing that race by blk_mq_tagset_busy_iter() to iterate over pending SCSI commands?

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux