diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/fs/fs_fat32.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nuttx/fs/fs_fat32.c b/nuttx/fs/fs_fat32.c index 93ea721a9..22dd3b237 100644 --- a/nuttx/fs/fs_fat32.c +++ b/nuttx/fs/fs_fat32.c @@ -2154,8 +2154,8 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf /* File/directory size, access block size */ buf->st_size = DIR_GETFILESIZE(dirinfo.fd_entry); - buf->st_blksize = fs->fs_hwsectorsize; - buf->st_blocks = SEC_NSECTORS(fs, buf->st_size + SEC_NDXMASK(fs)); + buf->st_blksize = fs->fs_fatsecperclus * fs->fs_hwsectorsize; + buf->st_blocks = (buf->st_size + buf->st_blksize - 1) / buf->st_blksize; /* Times */ |