public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] um: ubd: Fix data corruption
@ 2010-09-28 21:47 Richard Weinberger
  2010-09-28 22:00 ` Andrew Morton
  0 siblings, 1 reply; 22+ messages in thread
From: Richard Weinberger @ 2010-09-28 21:47 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, jdike, user-mode-linux-devel, user-mode-linux-user,
	janjaap, geert, jaxboe, martin.petersen, adobriyan, cdfrey,
	Richard Weinberger

Under high load the file system gets corrupted.
This patch fixes the issue.

Many thanks to Janjaap Bos <janjaap@bos.nl>!

LKML-Reference: <AANLkTi=PTp7YW_eYxtF-H2QSxgei3whWH59wU0C9oCkz () mail ! gmail ! com>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/drivers/ubd_kern.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 1bcd208..2874b83 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -748,9 +748,12 @@ static int ubd_open_dev(struct ubd *ubd_dev)
 	}
 	ubd_dev->fd = fd;
 
-	if(ubd_dev->cow.file != NULL){
-		blk_queue_max_hw_sectors(ubd_dev->queue, 8 * sizeof(long));
+	/* A setting higher than 1 sector currently (>= v2.6.31) generates
+		data loss, both for raw and cow ubd. */
+	blk_queue_max_hw_sectors(ubd_dev->queue, 1 * sizeof(long));
+	blk_queue_max_segments(ubd_dev->queue, 1 * sizeof(long));
 
+	if (ubd_dev->cow.file != NULL) {
 		err = -ENOMEM;
 		ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len);
 		if(ubd_dev->cow.bitmap == NULL){
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-10-15  4:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 21:47 [PATCH 1/1] um: ubd: Fix data corruption Richard Weinberger
2010-09-28 22:00 ` Andrew Morton
2010-09-28 22:13   ` Richard Weinberger
2010-09-28 22:52     ` Chris Frey
2010-09-28 23:10       ` Jens Axboe
2010-09-29  0:48         ` Janjaap Bos
2010-09-29  1:29         ` Chris Frey
2010-09-29  5:21           ` Jens Axboe
2010-09-29  6:34             ` Chris Frey
2010-10-04 16:37               ` Tejun Heo
2010-10-04 19:51                 ` Chris Frey
2010-10-05  8:23                   ` Tejun Heo
2010-10-05 20:31                     ` Chris Frey
2010-10-07  7:58                       ` Jens Axboe
2010-10-07 20:23                         ` Chris Frey
2010-10-14 13:14                           ` Tejun Heo
2010-10-14 14:20                             ` richard -rw- weinberger
2010-10-14 18:03                               ` Tejun Heo
2010-10-14 21:24                                 ` Richard Weinberger
2010-10-15  4:47                             ` Chris Frey
2010-10-02 17:27             ` richard -rw- weinberger
2010-09-29  3:30     ` Chris Frey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox