summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-01-26 22:43:12 +0800
committerbernard <[email protected]>2014-01-26 22:43:12 +0800
commit5a6ec7dcae9c92e06f6c6e129c2f9340cef93f09 (patch)
tree2815b8801ff4e7353cdfffc11aaf2b7deb034875 /components/dfs
parentba444f29f617134ccb18cd192b40d0ecae4eeeb7 (diff)
[DFS] fix the wrong field comparison in FAT mount.
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/filesystems/elmfat/dfs_elm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c
index 4495bd9b3e..3658a5dc80 100644
--- a/components/dfs/filesystems/elmfat/dfs_elm.c
+++ b/components/dfs/filesystems/elmfat/dfs_elm.c
@@ -25,6 +25,7 @@
* 2012-07-26 aozima implement ff_memalloc and ff_memfree.
* 2012-12-19 Bernard fixed the O_APPEND and lseek issue.
* 2013-03-01 aozima fixed the stat(st_mtime) issue.
+ * 2014-01-26 Bernard Check the sector size before mount.
*/
#include <rtthread.h>
@@ -122,9 +123,9 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
/* check sector size */
if (rt_device_control(fs->dev_id, RT_DEVICE_CTRL_BLK_GETGEOME, &geometry) == RT_EOK)
{
- if (geometry.block_size > _MAX_SS)
+ if (geometry.bytes_per_sector > _MAX_SS)
{
- rt_kprintf("Block size of device is great than sector size of FAT.\n");
+ rt_kprintf("The sector size of device is greater than the sector size of FAT.\n");
return -DFS_STATUS_EINVAL;
}
}