On a failure to recognize a FAT file system, the mount logic should return -EINVAL, not -ENODEV
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4297 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
203b6c58be
commit
67631ddea7
|
@ -2359,4 +2359,6 @@
|
||||||
GPIO is enabled. Also not adding the GPIO base address to several offsets.
|
GPIO is enabled. Also not adding the GPIO base address to several offsets.
|
||||||
* configs/stm32f4discovery: Port to the STMicro STM32F4Discovery board
|
* configs/stm32f4discovery: Port to the STMicro STM32F4Discovery board
|
||||||
(Contributed by Mike Smith).
|
(Contributed by Mike Smith).
|
||||||
|
* fs/fat/fs_fat32util.c: On a failure to recognize a FAT file system, the
|
||||||
|
mount logic should return -EINVAL, not -ENODEV.
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,7 @@ static int fat_checkfsinfo(struct fat_mountpt_s *fs)
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +143,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
MBR_GETSIGNATURE(fs->fs_buffer), MBR_GETBYTESPERSEC(fs->fs_buffer),
|
MBR_GETSIGNATURE(fs->fs_buffer), MBR_GETBYTESPERSEC(fs->fs_buffer),
|
||||||
fs->fs_hwsectorsize);
|
fs->fs_hwsectorsize);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify the FAT32 file system type. The determination of the file
|
/* Verify the FAT32 file system type. The determination of the file
|
||||||
|
@ -179,7 +180,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
fdbg("ERROR: fs_nfatsects %d fs_hwnsectors: %d\n",
|
fdbg("ERROR: fs_nfatsects %d fs_hwnsectors: %d\n",
|
||||||
fs->fs_nfatsects, fs->fs_hwnsectors);
|
fs->fs_nfatsects, fs->fs_hwnsectors);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the total number of sectors on the volume. */
|
/* Get the total number of sectors on the volume. */
|
||||||
|
@ -199,7 +200,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
fdbg("ERROR: fs_fattotsec %d fs_hwnsectors: %d\n",
|
fdbg("ERROR: fs_fattotsec %d fs_hwnsectors: %d\n",
|
||||||
fs->fs_fattotsec, fs->fs_hwnsectors);
|
fs->fs_fattotsec, fs->fs_hwnsectors);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the total number of reserved sectors */
|
/* Get the total number of reserved sectors */
|
||||||
|
@ -210,7 +211,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
fdbg("ERROR: fs_fatresvdseccount %d fs_hwnsectors: %d\n",
|
fdbg("ERROR: fs_fatresvdseccount %d fs_hwnsectors: %d\n",
|
||||||
fs->fs_fatresvdseccount, fs->fs_hwnsectors);
|
fs->fs_fatresvdseccount, fs->fs_hwnsectors);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of FATs. This is probably two but could have other values */
|
/* Get the number of FATs. This is probably two but could have other values */
|
||||||
|
@ -226,7 +227,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
fdbg("ERROR: ndatasectors %d fs_hwnsectors: %d\n",
|
fdbg("ERROR: ndatasectors %d fs_hwnsectors: %d\n",
|
||||||
ndatasectors, fs->fs_hwnsectors);
|
ndatasectors, fs->fs_hwnsectors);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the sectors per cluster */
|
/* Get the sectors per cluster */
|
||||||
|
@ -259,7 +260,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
||||||
fdbg("ERROR: notfat32: %d fs_nclusters: %d\n",
|
fdbg("ERROR: notfat32: %d fs_nclusters: %d\n",
|
||||||
notfat32, fs->fs_nclusters);
|
notfat32, fs->fs_nclusters);
|
||||||
|
|
||||||
return -ENODEV;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We have what appears to be a valid FAT filesystem! Save a few more things
|
/* We have what appears to be a valid FAT filesystem! Save a few more things
|
||||||
|
|
Loading…
Reference in New Issue