[PATCH 2/2] libata: disable preemption during PIO copy

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

 



If the request has been made in user context it could be moved to a
different CPU on a SMP machine between the copy and cache flush. Thus we
could flush the dcache on the wrong CPU.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx>
---
 drivers/ata/libata-sff.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 83ecf48..dca9f90 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -874,6 +874,9 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
 
 	DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
 
+#ifdef CONFIG_SMP
+	preempt_disable();
+#endif
 	if (PageHighMem(page)) {
 		unsigned long flags;
 
@@ -896,6 +899,9 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
 	if (!do_write && !PageSlab(page))
 		flush_dcache_page(page);
 
+#ifdef CONFIG_SMP
+	preempt_enable();
+#endif
 	qc->curbytes += qc->sect_size;
 	qc->cursg_ofs += qc->sect_size;
 
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux