VirtualBox

Changeset 16466 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2009 3:46:34 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42347
Message:

Linux additions: fixed file corruption when writing in append mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r15902 r16466  
    123123        struct sf_glob_info *sf_g = GET_GLOB_INFO (inode->i_sb);
    124124        struct sf_reg_info *sf_r = file->private_data;
    125         loff_t pos = (file->f_flags & O_APPEND)
    126                        ? inode->i_size
    127                        : *off;
     125        loff_t pos;
    128126
    129127        TRACE ();
     
    137135        }
    138136
     137        pos = *off;
     138        if (file->f_flags & O_APPEND)
     139                pos += inode->i_size;
     140
    139141        /** XXX Check write permission accoring to inode->i_mode! */
    140142
    141         if (!size) {
     143        if (!size)
    142144                return 0;
    143         }
    144145
    145146        tmp = kmalloc (CHUNK_SIZE, GFP_KERNEL);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette