Changeset 36cb22f in mainline for uspace/srv/fs/mfs/mfs_rw.c


Ignore:
Timestamp:
2011-09-27T13:01:54Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5726a1a3, 747a1e71
Parents:
1db44ea
Message:

fix a bug in the mfs_write() and mfs_read_map() functions.

  • mfs_read_map(): the inode size must be rounded up to the block size before testing

if "pos" is beyond the end of file.

  • mfs_write(): fix inode size calculation and set BLOCK_FLAGS_NOREAD when a new block is allocated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/mfs/mfs_rw.c

    r1db44ea r36cb22f  
    3131 */
    3232
     33#include <align.h>
    3334#include "mfs.h"
    3435
     
    7071        int rblock = pos / block_size;
    7172
    72         if (mnode->ino_i->i_size < pos) {
     73        if (ROUND_UP(mnode->ino_i->i_size, sbi->block_size) < pos) {
    7374                /*Trying to read beyond the end of file*/
    7475                r = EOK;
Note: See TracChangeset for help on using the changeset viewer.