Cannot partition 32GB disk on a 32bit machine

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

 



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);
 }
 


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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux