linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cannot partition 32GB disk on a 32bit machine
@ 2014-06-19  9:30 Alan Cox
  2014-06-19  9:33 ` Cannot partition 32GB disk on a 32bit machine (correct version of the patch this time) Cox, Alan
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2014-06-19  9:30 UTC (permalink / raw)
  To: linux-fsdevel, akpm, aeb, linux-kernel

The block code has 32bit cleanness problems with the iterator. This
prevents things like partitioning a 32GB volume on a 32bit system.

I hit this with a volume of exactly 32GB in size (easy to duplicate with
virtual machines). Tracing at step by step through the kernel I found
the problem lines in blkdev_read_iter which truncates the size value
into a 32bit value when setting up the iterator.

The hack below if applied "fixes" this and I think demonstrates that
this is the problem spot.

What I'm less clear on is what the correct fix for this should be.


diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6d72746..3792406 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1603,6 +1603,9 @@ static ssize_t blkdev_read_iter(struct kiocb
*iocb, struct iov_iter *to)
 
 	size -= pos;
 	iov_iter_truncate(to, size);
+	/* Fix up for 32bit boxes for now */
+	if (to->count < size)
+	        to->count = size;
 	return generic_file_read_iter(iocb, to);
 }
 

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

end of thread, other threads:[~2014-06-19 23:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19  9:30 Cannot partition 32GB disk on a 32bit machine Alan Cox
2014-06-19  9:33 ` Cannot partition 32GB disk on a 32bit machine (correct version of the patch this time) Cox, Alan
2014-06-19 18:43   ` James Bottomley
2014-06-19 20:51     ` Andrew Morton
2014-06-19 21:12     ` Paul Bolle
2014-06-19 23:04     ` Alan Cox
2014-06-19 23:44       ` James Bottomley
2014-06-19 21:12   ` Andries E. Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).