lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 10 Aug 2008 17:35:34 +0200
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	linux-ide@...r.kernel.org
Cc:	Borislav Petkov <petkovbb@...il.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 01/22] ide-floppy: fixup ide_floppy_io_buffers()

map hwif->sg_{table,nents} on pc->{sg,sg_cnt} (multi-IRQs-per-sg fix)

Cc: Borislav Petkov <petkovbb@...il.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
---
I will fold this into the original patch later.

 drivers/ide/ide-floppy.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -213,12 +213,11 @@ static void ide_floppy_io_buffers(ide_dr
 	ide_hwif_t *hwif = drive->hwif;
 	const struct ide_tp_ops *tp_ops = hwif->tp_ops;
 	xfer_func_t *xf = direction ? tp_ops->output_data : tp_ops->input_data;
-	struct scatterlist *sg = hwif->sg_table;
+	struct scatterlist *sg = pc->sg;
 	char *buf;
 	int count, done = 0;
 
 	while (bcount) {
-
 		count = min(sg->length - pc->b_count, bcount);
 		if (PageHighMem(sg_page(sg))) {
 			unsigned long flags;
@@ -237,9 +236,9 @@ static void ide_floppy_io_buffers(ide_dr
 		done += count;
 
 		if (pc->b_count == sg->length) {
-			if (!--hwif->sg_nents)
+			if (!--pc->sg_cnt)
 				break;
-			sg = sg_next(sg);
+			pc->sg = sg = sg_next(sg);
 			pc->b_count = 0;
 		}
 	}
@@ -576,6 +575,7 @@ static ide_startstop_t idefloppy_do_requ
 		struct request *rq, sector_t block_s)
 {
 	idefloppy_floppy_t *floppy = drive->driver_data;
+	ide_hwif_t *hwif = drive->hwif;
 	struct ide_atapi_pc *pc;
 	unsigned long block = (unsigned long)block_s;
 
@@ -618,11 +618,14 @@ static ide_startstop_t idefloppy_do_requ
 		return ide_stopped;
 	}
 
-	pc->rq = rq;
-
 	ide_init_sg_cmd(drive, rq);
 	ide_map_sg(drive, rq);
 
+	pc->sg = hwif->sg_table;
+	pc->sg_cnt = hwif->sg_nents;
+
+	pc->rq = rq;
+
 	return idefloppy_issue_pc(drive, pc);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ