On 08/15/2018 01:48 PM, Arkasha wrote:
This fixes the problem of the impossibility to create FAT disks larger than 504 
mb:
The change CHS made it possible to obtain a larger disk.
Also, auto-detection of disk parameters was added depending on the volume of 
the connected files:
The size of all folders and files on the created disk is calculated and the 
size of the FAT table is added.
This size allows to choose the future size of the FAT drive from the standard 
limitations.

Long lines. In commit messages, it's nice to manually wrap around 72 columns, so that even if you are reading messages indented (such as via 'git log') in an 80 column screen, they are still legible.


Signed-off-by: Ivanov Arkasha <[email protected]>
---
  block/vvfat.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
  1 file changed, 84 insertions(+), 11 deletions(-)

I'm not reviewing this closely, but I did spot this:

@@ -1440,7 +1513,7 @@ read_cluster_directory:
  static void print_direntry(const direntry_t* direntry)
  {
      int j = 0;
-    char buffer[1024];
+    char buffer[65536];

This is a bad idea. Anything larger than 4k should be heap-allocated rather than stack-allocated, so that you don't accidentally skip past OS guard pages in place to prevent stack overflow from running wild.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to