e2fsprogs/e2fsprogs-1.39-large_file_size.patch
Eric Sandeen 3b7ddeed65 e2fsprogs 16T fixes from upstream.
make package metadata refer to ext3 as well as ext2.
2006-09-27 19:26:10 +00:00

17 lines
603 B
Diff

Index: e2fsprogs-1.39-my-patches-from-ted/lib/ext2fs/getsize.c
===================================================================
--- e2fsprogs-1.39-my-patches-from-ted.orig/lib/ext2fs/getsize.c
+++ e2fsprogs-1.39-my-patches-from-ted/lib/ext2fs/getsize.c
@@ -250,6 +250,11 @@ errcode_t ext2fs_get_device_size(const c
if (fstat(fd, &st) == 0)
#endif
if (S_ISREG(st.st_mode)) {
+ if ((sizeof(*retblocks) < sizeof(unsigned long long)) &&
+ ((st.st_size / blocksize) > 0xFFFFFFFF)) {
+ rc = EFBIG;
+ goto out;
+ }
*retblocks = st.st_size / blocksize;
goto out;
}